Java 类com.intellij.uiDesigner.propertyInspector.PropertyInspector 实例源码

项目:intellij-ce-playground    文件:GuiEditor.java   
public Object getData(final String dataId) {
  if (PlatformDataKeys.HELP_ID.is(dataId)) {
    return ourHelpID;
  }

  // Standard Swing cut/copy/paste actions should work if user is editing something inside property inspector
  Project project = getProject();
  if (project.isDisposed()) return null;
  final PropertyInspector inspector = DesignerToolWindowManager.getInstance(this).getPropertyInspector();
  if (inspector != null && inspector.isEditing()) {
    return null;
  }

  if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
    return myDeleteProvider;
  }

  if (PlatformDataKeys.COPY_PROVIDER.is(dataId) ||
      PlatformDataKeys.CUT_PROVIDER.is(dataId) ||
      PlatformDataKeys.PASTE_PROVIDER.is(dataId)) {
    return myCutCopyPasteSupport;
  }

  return null;
}
项目:intellij-ce-playground    文件:ComponentTreeBuilder.java   
private void updateSelection() {
  final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(myEditor).getPropertyInspector();
  if (propertyInspector.isEditing()) {
    propertyInspector.stopEditing();
  }

  if(myInsideChange > 0){
    return;
  }
  myInsideChange++;
  try {
    updateFromRoot();
    syncSelection();
  } finally {
    myInsideChange--;
  }
}
项目:tools-idea    文件:ResetValueAction.java   
public static void doResetValue(final List<RadComponent> selection, final Property property, final GuiEditor editor) {
  try {
    if (!editor.ensureEditable()) return;
    final PropertyInspector propertyInspector = UIDesignerToolWindowManager.getInstance(editor.getProject()).getPropertyInspector();
    if (propertyInspector.isEditing()) {
      propertyInspector.stopEditing();
    }
    //noinspection unchecked
    for(RadComponent component: selection) {
      //noinspection unchecked
      if (property.isModified(component)) {
        //noinspection unchecked
        property.resetValue(component);
        component.getDelegee().invalidate();
      }
    }
    editor.refreshAndSave(false);
    propertyInspector.repaint();
  }
  catch (Exception e1) {
    LOG.error(e1);
  }
}
项目:tools-idea    文件:GuiEditor.java   
public Object getData(final String dataId) {
  if (PlatformDataKeys.HELP_ID.is(dataId)) {
    return ourHelpID;
  }

  // Standard Swing cut/copy/paste actions should work if user is editing something inside property inspector
  Project project = getProject();
  if (project.isDisposed()) return null;
  final UIDesignerToolWindowManager manager = UIDesignerToolWindowManager.getInstance(project);
  final PropertyInspector inspector = manager.getPropertyInspector();
  if (inspector != null && inspector.isEditing()) {
    return null;
  }

  if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
    return myDeleteProvider;
  }

  if (PlatformDataKeys.COPY_PROVIDER.is(dataId) ||
      PlatformDataKeys.CUT_PROVIDER.is(dataId) ||
      PlatformDataKeys.PASTE_PROVIDER.is(dataId)) {
    return myCutCopyPasteSupport;
  }

  return null;
}
项目:tools-idea    文件:ComponentTreeBuilder.java   
private void updateSelection() {
  final PropertyInspector propertyInspector = UIDesignerToolWindowManager.getInstance(myEditor.getProject()).getPropertyInspector();
  if (propertyInspector.isEditing()) {
    propertyInspector.stopEditing();
  }

  if(myInsideChange > 0){
    return;
  }
  myInsideChange++;
  try {
    updateFromRoot();
    syncSelection();
  } finally {
    myInsideChange--;
  }
}
项目:consulo-ui-designer    文件:ShowHintAction.java   
@Override
public void actionPerformed(final AnActionEvent e)
{
    final GuiEditor editor = myManager.getEditor();
    if(editor == null)
    {
        return;
    }

    // 1. Show light bulb
    myManager.showIntentionHint();

    // 2. Commit possible non committed value and show popup
    final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(myManager.getEditor()).getPropertyInspector();
    if(propertyInspector != null && propertyInspector.isEditing())
    {
        propertyInspector.stopEditing();
    }
    myManager.showIntentionPopup();
}
项目:consulo-ui-designer    文件:ComponentTreeBuilder.java   
private void updateSelection()
{
    final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(myEditor).getPropertyInspector();
    if(propertyInspector.isEditing())
    {
        propertyInspector.stopEditing();
    }

    if(myInsideChange > 0)
    {
        return;
    }
    myInsideChange++;
    try
    {
        updateFromRoot();
        syncSelection();
    }
    finally
    {
        myInsideChange--;
    }
}
项目:intellij-ce-playground    文件:ShowHintAction.java   
public void actionPerformed(final AnActionEvent e) {
  final GuiEditor editor = myManager.getEditor();
  if (editor == null) return;

  // 1. Show light bulb
  myManager.showIntentionHint();

  // 2. Commit possible non committed value and show popup
  final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(myManager.getEditor()).getPropertyInspector();
  if(propertyInspector != null && propertyInspector.isEditing()) {
    propertyInspector.stopEditing();
  }
  myManager.showIntentionPopup();
}
项目:intellij-ce-playground    文件:GuiEditor.java   
public void refreshAndSave(final boolean forceSync) {
  // Update property inspector
  final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(this).getPropertyInspector();
  if (propertyInspector != null) {
    propertyInspector.synchWithTree(forceSync);
  }

  refresh();
  saveToFile();
  // TODO[yole]: install appropriate listeners so that the captions repaint themselves at correct time
  myHorzCaptionPanel.repaint();
  myVertCaptionPanel.repaint();
}
项目:intellij-ce-playground    文件:GuiEditor.java   
private void refreshProperties() {
  final Ref<Boolean> anythingModified = new Ref<Boolean>();
  FormEditingUtil.iterate(myRootContainer, new FormEditingUtil.ComponentVisitor() {
    public boolean visit(final IComponent component) {
      final RadComponent radComponent = (RadComponent)component;
      boolean componentModified = false;
      for (IProperty prop : component.getModifiedProperties()) {
        if (prop instanceof IntroStringProperty) {
          IntroStringProperty strProp = (IntroStringProperty)prop;
          componentModified = strProp.refreshValue(radComponent) || componentModified;
        }
      }

      if (component instanceof RadContainer) {
        componentModified = ((RadContainer)component).updateBorder() || componentModified;
      }

      if (component.getParentContainer() instanceof RadTabbedPane) {
        componentModified = ((RadTabbedPane)component.getParentContainer()).refreshChildTitle(radComponent) || componentModified;
      }
      if (componentModified) {
        anythingModified.set(Boolean.TRUE);
      }

      return true;
    }
  });
  if (!anythingModified.isNull()) {
    refresh();
    DesignerToolWindow designerToolWindow = DesignerToolWindowManager.getInstance(this);
    ComponentTree tree = designerToolWindow.getComponentTree();
    if (tree != null) tree.repaint();
    PropertyInspector inspector = designerToolWindow.getPropertyInspector();
    if (inspector != null) inspector.synchWithTree(true);
  }
}
项目:tools-idea    文件:ShowHintAction.java   
public void actionPerformed(final AnActionEvent e) {
  final GuiEditor editor = myManager.getEditor();
  if (editor == null) return;

  // 1. Show light bulb
  myManager.showIntentionHint();

  // 2. Commit possible non committed value and show popup
  final UIDesignerToolWindowManager manager = UIDesignerToolWindowManager.getInstance(editor.getProject());
  final PropertyInspector propertyInspector = manager.getPropertyInspector();
  if(propertyInspector != null && propertyInspector.isEditing()) {
    propertyInspector.stopEditing();
  }
  myManager.showIntentionPopup();
}
项目:tools-idea    文件:GuiEditor.java   
public void refreshAndSave(final boolean forceSync) {
  // Update property inspector
  final UIDesignerToolWindowManager manager = UIDesignerToolWindowManager.getInstance(getProject());
  final PropertyInspector propertyInspector = manager.getPropertyInspector();
  if (propertyInspector != null) {
    propertyInspector.synchWithTree(forceSync);
  }

  refresh();
  saveToFile();
  // TODO[yole]: install appropriate listeners so that the captions repaint themselves at correct time
  myHorzCaptionPanel.repaint();
  myVertCaptionPanel.repaint();
}
项目:consulo-ui-designer    文件:ResetValueAction.java   
public static void doResetValue(final List<RadComponent> selection, final Property property, final GuiEditor editor)
{
    try
    {
        if(!editor.ensureEditable())
        {
            return;
        }
        final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(editor).getPropertyInspector();
        if(propertyInspector.isEditing())
        {
            propertyInspector.stopEditing();
        }
        //noinspection unchecked
        for(RadComponent component : selection)
        {
            //noinspection unchecked
            if(property.isModified(component))
            {
                //noinspection unchecked
                property.resetValue(component);
                component.getDelegee().invalidate();
            }
        }
        editor.refreshAndSave(false);
        propertyInspector.repaint();
    }
    catch(Exception e1)
    {
        LOG.error(e1);
    }
}
项目:consulo-ui-designer    文件:GuiEditor.java   
public void refreshAndSave(final boolean forceSync)
{
    // Update property inspector
    final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(this).getPropertyInspector();
    if(propertyInspector != null)
    {
        propertyInspector.synchWithTree(forceSync);
    }

    refresh();
    saveToFile();
    // TODO[yole]: install appropriate listeners so that the captions repaint themselves at correct time
    myHorzCaptionPanel.repaint();
    myVertCaptionPanel.repaint();
}
项目:consulo-ui-designer    文件:GuiEditor.java   
@Override
public Object getData(@NotNull final Key<?> dataId)
{
    if(PlatformDataKeys.HELP_ID == dataId)
    {
        return ourHelpID;
    }

    // Standard Swing cut/copy/paste actions should work if user is editing something inside property inspector
    Project project = getProject();
    if(project.isDisposed())
    {
        return null;
    }
    final PropertyInspector inspector = DesignerToolWindowManager.getInstance(this).getPropertyInspector();
    if(inspector != null && inspector.isEditing())
    {
        return null;
    }

    if(PlatformDataKeys.DELETE_ELEMENT_PROVIDER == dataId)
    {
        return myDeleteProvider;
    }

    if(PlatformDataKeys.COPY_PROVIDER == dataId ||
            PlatformDataKeys.CUT_PROVIDER == dataId ||
            PlatformDataKeys.PASTE_PROVIDER == dataId)
    {
        return myCutCopyPasteSupport;
    }

    return null;
}
项目:intellij-ce-playground    文件:GuiEditor.java   
public void update(final AnActionEvent e) {
  PropertyInspector inspector = DesignerToolWindowManager.getInstance(GuiEditor.this).getPropertyInspector();
  e.getPresentation().setEnabled(inspector != null && !inspector.isEditing());
}
项目:tools-idea    文件:GuiEditor.java   
public void update(final AnActionEvent e) {
  final UIDesignerToolWindowManager manager = UIDesignerToolWindowManager.getInstance(getProject());
  PropertyInspector inspector = manager.getPropertyInspector();
  e.getPresentation().setEnabled(inspector != null && !inspector.isEditing());
}
项目:consulo-ui-designer    文件:GuiEditor.java   
private void refreshProperties()
{
    final Ref<Boolean> anythingModified = new Ref<Boolean>();
    FormEditingUtil.iterate(myRootContainer, new FormEditingUtil.ComponentVisitor()
    {
        @Override
        public boolean visit(final IComponent component)
        {
            final RadComponent radComponent = (RadComponent) component;
            boolean componentModified = false;
            for(IProperty prop : component.getModifiedProperties())
            {
                if(prop instanceof IntroStringProperty)
                {
                    IntroStringProperty strProp = (IntroStringProperty) prop;
                    componentModified = strProp.refreshValue(radComponent) || componentModified;
                }
            }

            if(component instanceof RadContainer)
            {
                componentModified = ((RadContainer) component).updateBorder() || componentModified;
            }

            if(component.getParentContainer() instanceof RadTabbedPane)
            {
                componentModified = ((RadTabbedPane) component.getParentContainer()).refreshChildTitle(radComponent) || componentModified;
            }
            if(componentModified)
            {
                anythingModified.set(Boolean.TRUE);
            }

            return true;
        }
    });
    if(!anythingModified.isNull())
    {
        refresh();
        DesignerToolWindow designerToolWindow = DesignerToolWindowManager.getInstance(this);
        ComponentTree tree = designerToolWindow.getComponentTree();
        if(tree != null)
        {
            tree.repaint();
        }
        PropertyInspector inspector = designerToolWindow.getPropertyInspector();
        if(inspector != null)
        {
            inspector.synchWithTree(true);
        }
    }
}
项目:consulo-ui-designer    文件:GuiEditor.java   
@Override
public void update(final AnActionEvent e)
{
    PropertyInspector inspector = DesignerToolWindowManager.getInstance(GuiEditor.this).getPropertyInspector();
    e.getPresentation().setEnabled(inspector != null && !inspector.isEditing());
}