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; }
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--; } }
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); } }
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; }
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--; } }
@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(); }
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--; } }
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(); }
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(); }
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); } }
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(); }
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(); }
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); } }
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(); }
@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; }
public void update(final AnActionEvent e) { PropertyInspector inspector = DesignerToolWindowManager.getInstance(GuiEditor.this).getPropertyInspector(); e.getPresentation().setEnabled(inspector != null && !inspector.isEditing()); }
public void update(final AnActionEvent e) { final UIDesignerToolWindowManager manager = UIDesignerToolWindowManager.getInstance(getProject()); PropertyInspector inspector = manager.getPropertyInspector(); e.getPresentation().setEnabled(inspector != null && !inspector.isEditing()); }
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); } } }
@Override public void update(final AnActionEvent e) { PropertyInspector inspector = DesignerToolWindowManager.getInstance(GuiEditor.this).getPropertyInspector(); e.getPresentation().setEnabled(inspector != null && !inspector.isEditing()); }