Java 类com.intellij.uiDesigner.componentTree.ComponentTreeBuilder 实例源码

项目:intellij-ce-playground    文件:FormEditingUtil.java   
public static void selectSingleComponent(final GuiEditor editor, final RadComponent component) {
  final RadContainer root = (RadContainer)getRoot(component);
  if (root == null) return;

  ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder();
  // this can return null if the click to select the control also requested to grab the focus -
  // the component tree will be instantiated after the event has been processed completely
  if (builder != null) {
    builder.beginUpdateSelection();
  }
  try {
    clearSelection(root);
    selectComponent(editor, component);
    editor.setSelectionAnchor(component);
    editor.scrollComponentInView(component);
  }
  finally {
    if (builder != null) {
      builder.endUpdateSelection();
    }
  }
}
项目:intellij-ce-playground    文件:FormEditingUtil.java   
public static void selectComponents(final GuiEditor editor, List<RadComponent> components) {
  if (components.size() > 0) {
    RadComponent component = components.get(0);
    ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder();
    if (builder == null) {
      // race condition when handling event?
      return;
    }
    builder.beginUpdateSelection();
    try {
      clearSelection((RadContainer)getRoot(component));
      for (RadComponent aComponent : components) {
        selectComponent(editor, aComponent);
      }
    }
    finally {
      builder.endUpdateSelection();
    }
  }
}
项目:tools-idea    文件:FormEditingUtil.java   
public static void selectSingleComponent(final GuiEditor editor, final RadComponent component) {
  final RadContainer root = (RadContainer)getRoot(component);
  if (root == null) return;

  ComponentTreeBuilder builder = UIDesignerToolWindowManager.getInstance(component.getProject()).getComponentTreeBuilder();
  // this can return null if the click to select the control also requested to grab the focus -
  // the component tree will be instantiated after the event has been processed completely
  if (builder != null) {
    builder.beginUpdateSelection();
  }
  try {
    clearSelection(root);
    selectComponent(editor, component);
    editor.setSelectionAnchor(component);
    editor.scrollComponentInView(component);
  }
  finally {
    if (builder != null) {
      builder.endUpdateSelection();
    }
  }
}
项目:tools-idea    文件:FormEditingUtil.java   
public static void selectComponents(final GuiEditor editor, List<RadComponent> components) {
  if (components.size() > 0) {
    RadComponent component = components.get(0);
    ComponentTreeBuilder builder = UIDesignerToolWindowManager.getInstance(component.getProject()).getComponentTreeBuilder();
    if (builder == null) {
      // race condition when handling event?
      return;
    }
    builder.beginUpdateSelection();
    try {
      clearSelection((RadContainer)getRoot(component));
      for (RadComponent aComponent : components) {
        selectComponent(editor, aComponent);
      }
    }
    finally {
      builder.endUpdateSelection();
    }
  }
}
项目:consulo-ui-designer    文件:FormEditingUtil.java   
public static void selectComponents(final GuiEditor editor, List<RadComponent> components)
{
    if(components.size() > 0)
    {
        RadComponent component = components.get(0);
        ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder();
        if(builder == null)
        {
            // race condition when handling event?
            return;
        }
        builder.beginUpdateSelection();
        try
        {
            clearSelection((RadContainer) getRoot(component));
            for(RadComponent aComponent : components)
            {
                selectComponent(editor, aComponent);
            }
        }
        finally
        {
            builder.endUpdateSelection();
        }
    }
}
项目:consulo-ui-designer    文件:DesignerToolWindow.java   
public void update(GuiEditor designer)
{
    clearTreeBuilder();

    myComponentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
    myComponentTree.setEditor(designer);
    myPropertyInspector.setEditor(designer);

    if(designer == null)
    {
        myComponentTree.setFormEditor(null);
    }
    else
    {
        myComponentTree.setFormEditor(designer.getEditor());
        myComponentTreeBuilder = new ComponentTreeBuilder(myComponentTree, designer);
    }
}
项目:consulo-ui-designer    文件:SelectAllComponentsAction.java   
@Override
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()
        {
            @Override
            public boolean visit(final IComponent component)
            {
                ((RadComponent) component).setSelected(true);
                return true;
            }
        });
    }
    finally
    {
        builder.endUpdateSelection();
    }
}
项目:intellij-ce-playground    文件:DesignerToolWindow.java   
public void update(GuiEditor designer) {
  clearTreeBuilder();

  myComponentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
  myComponentTree.setEditor(designer);
  myPropertyInspector.setEditor(designer);

  if (designer == null) {
    myComponentTree.setFormEditor(null);
  }
  else {
    myComponentTree.setFormEditor(designer.getEditor());
    myComponentTreeBuilder = new ComponentTreeBuilder(myComponentTree, designer);
  }
}
项目:intellij-ce-playground    文件:SelectAllComponentsAction.java   
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();
  }
}
项目:tools-idea    文件:SelectAllComponentsAction.java   
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  final ComponentTreeBuilder builder = UIDesignerToolWindowManager.getInstance(editor.getProject()).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();
  }
}
项目:consulo-ui-designer    文件:FormEditingUtil.java   
public static void selectSingleComponent(final GuiEditor editor, final RadComponent component)
{
    final RadContainer root = (RadContainer) getRoot(component);
    if(root == null)
    {
        return;
    }

    ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder();
    // this can return null if the click to select the control also requested to grab the focus -
    // the component tree will be instantiated after the event has been processed completely
    if(builder != null)
    {
        builder.beginUpdateSelection();
    }
    try
    {
        clearSelection(root);
        selectComponent(editor, component);
        editor.setSelectionAnchor(component);
        editor.scrollComponentInView(component);
    }
    finally
    {
        if(builder != null)
        {
            builder.endUpdateSelection();
        }
    }
}
项目:intellij-ce-playground    文件:DesignerToolWindow.java   
public ComponentTreeBuilder getComponentTreeBuilder() {
  return myComponentTreeBuilder;
}
项目:tools-idea    文件:UIDesignerToolWindowManager.java   
public ComponentTreeBuilder getComponentTreeBuilder() {
  return myComponentTreeBuilder;
}
项目:tools-idea    文件:UIDesignerToolWindowManager.java   
public void updateComponentTree() {
  final ComponentTreeBuilder builder = myComponentTreeBuilder;
  if (builder != null) {
    builder.queueUpdate();
  }
}
项目:consulo-ui-designer    文件:DesignerToolWindow.java   
public ComponentTreeBuilder getComponentTreeBuilder()
{
    return myComponentTreeBuilder;
}