Java 类com.intellij.ui.treeStructure.SimpleTreeBuilder 实例源码

项目:salesforce-plugin    文件:MetadataExplorerToolWindowFactory.java   
private void setupMetadataPanel(Project project, SimpleToolWindowPanel metadataPanel) {
    RestClientService restClientService = ServiceManager.getService(project, RestClientService.class);
    SimpleNode metadataRootNode = new MetadataExplorerRootNode(project, restClientService, "Metadata");

    SimpleTree metadataTree = new SimpleTree();
    SimpleTreeBuilder metadataTreeBuilder = new SimpleTreeBuilder(metadataTree, (DefaultTreeModel)metadataTree.getModel(), new ExplorerTreeStructure(metadataRootNode), null);
    Disposer.register(project, metadataTreeBuilder);
    metadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(metadataTreeBuilder));
    metadataTree.setCellRenderer(new ExplorerCellRenderer());

    ActionToolbar toolbar = createToolbar(metadataRootNode, metadataTreeBuilder);
    toolbar.setTargetComponent(metadataPanel);
    metadataPanel.setToolbar(toolbar.getComponent());
    metadataPanel.setContent(ScrollPaneFactory.createScrollPane(metadataTree));

    metadataTree.setShowsRootHandles(true);

}
项目:salesforce-plugin    文件:MetadataExplorerToolWindowFactory.java   
private void setupToolingMetadataPanel(Project project, SimpleToolWindowPanel toolingMetadataPanel) {
    ToolingRestClientService toolingRestClientService = ServiceManager.getService(project, ToolingRestClientService.class);
    SimpleNode toolingMetadataRootNode = new MetadataExplorerRootNode(project, toolingRestClientService, " Tooling Metadata");

    SimpleTree toolingMetadataTree = new SimpleTree();
    SimpleTreeBuilder toolingMetadataTreeBuilder = new SimpleTreeBuilder(toolingMetadataTree, (DefaultTreeModel)toolingMetadataTree.getModel(), new ExplorerTreeStructure(toolingMetadataRootNode), null);
    Disposer.register(project, toolingMetadataTreeBuilder);
    toolingMetadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(toolingMetadataTreeBuilder));
    toolingMetadataTree.setCellRenderer(new ExplorerCellRenderer());

    ActionToolbar toolbar = createToolbar(toolingMetadataRootNode, toolingMetadataTreeBuilder);
    toolbar.setTargetComponent(toolingMetadataPanel);
    toolingMetadataPanel.setToolbar(toolbar.getComponent());
    toolingMetadataPanel.setContent(ScrollPaneFactory.createScrollPane(toolingMetadataTree));

    toolingMetadataTree.setShowsRootHandles(true);

}
项目:intellij-plugin    文件:SeedStackStructure.java   
SeedStackStructure(Project project, SimpleTree tree) {
    this.project = project;

    tree.setRootVisible(true);
    tree.setShowsRootHandles(true);

    rootNode = new RootNode();
    treeBuilder = new SimpleTreeBuilder(tree, (DefaultTreeModel) tree.getModel(), this, null);
    Disposer.register(this.project, treeBuilder);

    treeBuilder.initRoot();
}
项目:intellij-ce-playground    文件:SourceItemsTree.java   
public SourceItemsTree(ArtifactEditorContext editorContext, ArtifactEditorImpl artifactsEditor) {
  myArtifactsEditor = artifactsEditor;
  myBuilder = new SimpleTreeBuilder(this, this.getBuilderModel(), new SourceItemsTreeStructure(editorContext, artifactsEditor), new WeightBasedComparator(true));
  setRootVisible(false);
  setShowsRootHandles(true);
  Disposer.register(this, myBuilder);
  PopupHandler.installPopupHandler(this, createPopupGroup(), ActionPlaces.UNKNOWN, ActionManager.getInstance());
  installDnD();
}
项目:IntelliJ_Jahia_plugin    文件:JahiaTreeStructure.java   
public JahiaTreeStructure(Project project, SimpleTree tree) {
    tree.setRootVisible(false);
    tree.setShowsRootHandles(true);

    myTreeBuilder = new SimpleTreeBuilder(tree, (DefaultTreeModel)tree.getModel(), this, null);
    Disposer.register(project, myTreeBuilder);

    myRoot = new RootNode(project);
    myTreeBuilder.expand(myRoot, null);
    myTreeBuilder.initRoot();
}
项目:Dynatrace-AppMon-IntelliJ-IDEA-Integration-Plugin    文件:TestRunResultsView.java   
/**
 * Populates table with appropriate metrics
 *
 * @param testRun - testRun to display inside the table
 */
public void setTestRun(TestRun testRun) {
    //setup presentation
    TestRunNode node = new TestRunNode(testRun);
    this.model.setRoot(new DefaultMutableTreeNode(node));
    final SimpleTreeStructure treeStructure = new SimpleTreeStructure.Impl(node);
    this.treeBuilder = new SimpleTreeBuilder(this.tree.getTree(), this.model, treeStructure, null);
    Disposer.register(this, this.treeBuilder);

    this.treeBuilder.expand(treeStructure.getRootElement(), () -> this.expandFailing(treeStructure, treeStructure.getRootElement()));

    this.treeBuilder.initRoot();
}
项目:tools-idea    文件:SourceItemsTree.java   
public SourceItemsTree(ArtifactEditorContext editorContext, ArtifactEditorImpl artifactsEditor) {
  myArtifactsEditor = artifactsEditor;
  myBuilder = new SimpleTreeBuilder(this, this.getBuilderModel(), new SourceItemsTreeStructure(editorContext, artifactsEditor), new WeightBasedComparator(true));
  setRootVisible(false);
  setShowsRootHandles(true);
  Disposer.register(this, myBuilder);
  PopupHandler.installPopupHandler(this, createPopupGroup(), ActionPlaces.UNKNOWN, ActionManager.getInstance());
  installDnD();
}
项目:salesforce-plugin    文件:DataExplorerToolWindowFactory.java   
private void setupDataSplitPane(Project project) {
    RestClientService restClientService = ServiceManager.getService(project, RestClientService.class);
    SimpleNode dataRootNode = new DataExplorerRootNode(project, restClientService, "sObjects");

    SimpleTree dataTree = new SimpleTree();
    dataTree.setShowsRootHandles(true);
    SimpleTreeBuilder dataTreeBuilder = new SimpleTreeBuilder(dataTree, (DefaultTreeModel) dataTree.getModel(), new ExplorerTreeStructure(dataRootNode), null);
    Disposer.register(project, dataTreeBuilder);
    dataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(dataTreeBuilder));
    dataTree.setCellRenderer(new ExplorerCellRenderer());
    JBTable dataTable = new JBTable();
    dataTable.setStriped(true);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    // Setup left panel which will display all the available sObjects
    SimpleToolWindowPanel treePanel = new SimpleToolWindowPanel(true, true);
    ActionToolbar treeToolbar = createTreeToolbar(dataRootNode, dataTreeBuilder);
    treeToolbar.setTargetComponent(treePanel);
    treePanel.setToolbar(treeToolbar.getComponent());
    treePanel.setContent(ScrollPaneFactory.createScrollPane(dataTree));
    dataSplitPane.add(treePanel, JSplitPane.LEFT);

    // Setup right panel which will display the data in the selected sObject
    SimpleToolWindowPanel dataPanel = new SimpleToolWindowPanel(true, true);
    ActionToolbar dataToolbar = createDataToolbar(dataTable);
    dataToolbar.setTargetComponent(dataPanel);
    dataPanel.setToolbar(dataToolbar.getComponent());
    dataPanel.setContent(ScrollPaneFactory.createScrollPane(dataTable));
    dataSplitPane.add(dataPanel, JSplitPane.RIGHT);

    dataSplitPane.getLeftComponent().setPreferredSize(new Dimension(250, 0));
    dataSplitPane.getRightComponent().setPreferredSize(new Dimension(0, 0));

    dataTree.addMouseListener(new DataExplorerMouseListener(dataTable, dataTree));

}
项目:salesforce-plugin    文件:DataExplorerToolWindowFactory.java   
private void setupToolingDataSplitPane(Project project) {
    ToolingRestClientService toolingRestClientService = ServiceManager.getService(project, ToolingRestClientService.class);
    SimpleNode toolingDataRootNode = new DataExplorerRootNode(project, toolingRestClientService, "Tooling sObjects");

    SimpleTree toolingDataTree = new SimpleTree();
    toolingDataTree.setShowsRootHandles(true);
    SimpleTreeBuilder toolingDataTreeBuilder = new SimpleTreeBuilder(toolingDataTree, (DefaultTreeModel) toolingDataTree.getModel(), new ExplorerTreeStructure(toolingDataRootNode), null);
    Disposer.register(project, toolingDataTreeBuilder);
    toolingDataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(toolingDataTreeBuilder));
    toolingDataTree.setCellRenderer(new ExplorerCellRenderer());
    JBTable toolingDataTable = new JBTable();
    toolingDataTable.setStriped(true);
    toolingDataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    // Setup left panel which will display all the available sObjects
    SimpleToolWindowPanel treePanel = new SimpleToolWindowPanel(true, true);
    ActionToolbar treeToolbar = createTreeToolbar(toolingDataRootNode, toolingDataTreeBuilder);
    treeToolbar.setTargetComponent(treePanel);
    treePanel.setToolbar(treeToolbar.getComponent());
    treePanel.setContent(ScrollPaneFactory.createScrollPane(toolingDataTree));
    toolingDataSplitPane.add(treePanel, JSplitPane.LEFT);

    // Setup right panel which will display the data in the selected sObject
    SimpleToolWindowPanel dataPanel = new SimpleToolWindowPanel(true, true);
    ActionToolbar dataToolbar = createDataToolbar(toolingDataTable);
    dataToolbar.setTargetComponent(dataPanel);
    dataPanel.setToolbar(dataToolbar.getComponent());
    dataPanel.setContent(ScrollPaneFactory.createScrollPane(toolingDataTable));
    toolingDataSplitPane.add(dataPanel, JSplitPane.RIGHT);

    toolingDataSplitPane.getLeftComponent().setPreferredSize(new Dimension(250, 0));
    toolingDataSplitPane.getRightComponent().setPreferredSize(new Dimension(0, 0));

    toolingDataTree.addMouseListener(new DataExplorerMouseListener(toolingDataTable, toolingDataTree));
}
项目:consulo    文件:SourceItemsTree.java   
public SourceItemsTree(ArtifactEditorContext editorContext, ArtifactEditorImpl artifactsEditor) {
  myArtifactsEditor = artifactsEditor;
  myBuilder = new SimpleTreeBuilder(this, this.getBuilderModel(), new SourceItemsTreeStructure(editorContext, artifactsEditor), new WeightBasedComparator(true));
  setRootVisible(false);
  setShowsRootHandles(true);
  Disposer.register(this, myBuilder);
  PopupHandler.installPopupHandler(this, createPopupGroup(), ActionPlaces.UNKNOWN, ActionManager.getInstance());
  installDnD();
}
项目:salesforce-plugin    文件:MetadataExplorerToolWindowFactory.java   
private ActionToolbar createToolbar(SimpleNode rootNode, SimpleTreeBuilder builder) {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new ExplorerCollapseAllAction(rootNode, builder));
    return ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
}
项目:salesforce-plugin    文件:DataExplorerToolWindowFactory.java   
private ActionToolbar createTreeToolbar(SimpleNode rootNode, SimpleTreeBuilder builder) {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new ExplorerCollapseAllAction(rootNode, builder));
    return ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
}
项目:salesforce-plugin    文件:ExplorerCollapseAllAction.java   
public ExplorerCollapseAllAction(SimpleNode rootNode, SimpleTreeBuilder builder) {
    super("Collapse All", "Collapse all nodes", AllIcons.Actions.Collapseall);
    this.rootNode = rootNode;
    this.builder = builder;
}
项目:salesforce-plugin    文件:ExplorerTreeExpansionListener.java   
public ExplorerTreeExpansionListener(SimpleTreeBuilder builder) {
    this.builder = builder;
}
项目:salesforce-plugin    文件:ExplorerTreeExpansionListener.java   
private RetrieveChildrenSwingWorker(AbstractExplorerNode node, SimpleTreeBuilder builder) {
    this.node = node;
    this.builder = builder;
}