Search in sources :

Example 6 with ComponentTreeBuilder

use of com.intellij.uiDesigner.componentTree.ComponentTreeBuilder in project intellij-community by JetBrains.

the class SelectAllComponentsAction method actionPerformed.

protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
    final ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder();
    builder.beginUpdateSelection();
    try {
        FormEditingUtil.iterate(editor.getRootContainer(), new FormEditingUtil.ComponentVisitor() {

            public boolean visit(final IComponent component) {
                ((RadComponent) component).setSelected(true);
                return true;
            }
        });
    } finally {
        builder.endUpdateSelection();
    }
}
Also used : IComponent(com.intellij.uiDesigner.lw.IComponent) FormEditingUtil(com.intellij.uiDesigner.FormEditingUtil) ComponentTreeBuilder(com.intellij.uiDesigner.componentTree.ComponentTreeBuilder)

Aggregations

ComponentTreeBuilder (com.intellij.uiDesigner.componentTree.ComponentTreeBuilder)6 SelectionState (com.intellij.uiDesigner.SelectionState)2 GuiEditor (com.intellij.uiDesigner.designSurface.GuiEditor)2 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)2 RadContainer (com.intellij.uiDesigner.radComponents.RadContainer)2 FormEditingUtil (com.intellij.uiDesigner.FormEditingUtil)1 ComponentPtr (com.intellij.uiDesigner.componentTree.ComponentPtr)1 IComponent (com.intellij.uiDesigner.lw.IComponent)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)1