当前位置: 首页>>代码示例>>Java>>正文


Java SimpleTree类代码示例

本文整理汇总了Java中com.intellij.ui.treeStructure.SimpleTree的典型用法代码示例。如果您正苦于以下问题:Java SimpleTree类的具体用法?Java SimpleTree怎么用?Java SimpleTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SimpleTree类属于com.intellij.ui.treeStructure包,在下文中一共展示了SimpleTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SwitchVersionAction

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
/**
 * Creates the action with its text, description and icon.
 *
 * @param tree             LivingDoc repository tree.
 * @param toWorkingVersion true for current/working version. False otherwise.
 */
public SwitchVersionAction(final SimpleTree tree, final boolean toWorkingVersion) {

    super();

    this.repositoryTree = tree;
    this.toCurrentVersion = toWorkingVersion;

    String text;
    Icon icon;

    if (toCurrentVersion) {
        text = I18nSupport.getValue("toolwindows.action.working.tooltip");
        icon = AllIcons.Actions.NewFolder;

    } else {
        text = I18nSupport.getValue("toolwindows.action.implemented.tooltip");
        icon = AllIcons.Actions.Module;
    }
    Presentation presentation = getTemplatePresentation();
    presentation.setText(text);
    presentation.setDescription(text);
    presentation.setIcon(icon);
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:30,代码来源:SwitchVersionAction.java

示例2: setupMetadataPanel

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
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);

}
 
开发者ID:polyglot-mark,项目名称:salesforce-plugin,代码行数:19,代码来源:MetadataExplorerToolWindowFactory.java

示例3: setupToolingMetadataPanel

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
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);

}
 
开发者ID:polyglot-mark,项目名称:salesforce-plugin,代码行数:19,代码来源:MetadataExplorerToolWindowFactory.java

示例4: handleDoubleClickOrEnter

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
    String actionId = getActionId();
    if (actionId != null) {
        NavigatorUtil.executeAction(actionId, inputEvent);
    } else if (!(this instanceof SeedStackGroupNode)) {
        Optional.ofNullable(getNavigatable()).ifPresent(navigatable -> navigatable.navigate(true));
    }
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:10,代码来源:SeedStackSimpleNode.java

示例5: initTree

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
private void initTree() {
    tree = new SimpleTree() {
        private final JLabel myLabel = new JLabel("This is not a SeedStack project.");

        @Override
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            if (!isSeedStackProject()) {
                myLabel.setFont(getFont());
                myLabel.setBackground(getBackground());
                myLabel.setForeground(getForeground());
                Rectangle bounds = getBounds();
                Dimension size = myLabel.getPreferredSize();
                myLabel.setBounds(0, 0, size.width, size.height);

                int x = (bounds.width - size.width) / 2;
                Graphics g2 = g.create(bounds.x + x, bounds.y + 20, bounds.width, bounds.height);
                try {
                    myLabel.paint(g2);
                } finally {
                    g2.dispose();
                }
            }
        }
    };
    tree.getEmptyText().clear();
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:29,代码来源:SeedStackNavigator.java

示例6: SeedStackStructure

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
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();
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:13,代码来源:SeedStackStructure.java

示例7: getSelectedNodes

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
static <T extends SimpleNode> List<T> getSelectedNodes(SimpleTree tree, Class<T> nodeClass) {
    final List<T> filtered = new ArrayList<>();
    for (SimpleNode node : getSelectedNodes(tree)) {
        if ((nodeClass != null) && (!nodeClass.isInstance(node))) {
            filtered.clear();
            break;
        }
        //noinspection unchecked
        filtered.add((T) node);
    }
    return filtered;
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:13,代码来源:SeedStackStructure.java

示例8: SeedStackNavigatorPanel

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
SeedStackNavigatorPanel(Project project, SimpleTree tree) {
    super(true, true);
    this.project = project;
    this.tree = tree;

    final ActionManager actionManager = ActionManager.getInstance();
    ActionToolbar actionToolbar = actionManager.createActionToolbar(
            "SeedStack Navigator Toolbar",
            (DefaultActionGroup) actionManager.getAction("SeedStack.NavigatorActionsToolbar"),
            true
    );
    actionToolbar.setTargetComponent(tree);
    setToolbar(actionToolbar.getComponent());
    setContent(ScrollPaneFactory.createScrollPane(tree));
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:16,代码来源:SeedStackNavigatorPanel.java

示例9: TagImplementedAction

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
/**
 * @param tree LivingDoc repository tree.
 */
public TagImplementedAction(final SimpleTree tree) {

    super(I18nSupport.getValue("toolwindows.action.tag.tooltip"),
            I18nSupport.getValue("toolwindows.action.tag.tooltip"),
            AllIcons.Actions.GroupByPackage);

    this.repositoryTree = tree;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:12,代码来源:TagImplementedAction.java

示例10: OpenRemoteDocumentAction

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
/**
 * Creates the action with its text, description and icon.
 *
 * @param tree LivingDoc repository tree.
 */
public OpenRemoteDocumentAction(final SimpleTree tree) {

    super(I18nSupport.getValue("toolwindows.action.open.tooltip"),
            I18nSupport.getValue("toolwindows.action.open.tooltip"),
            AllIcons.Javaee.WebModule);

    this.repositoryTree = tree;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:14,代码来源:OpenRemoteDocumentAction.java

示例11: createRepositoryTree

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
private void createRepositoryTree() {

        tree = new SimpleTree();
        tree.setCellRenderer(new TreeCellRendererLivingDoc());
        tree.setRootVisible(true);

        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);

        treeModel = new DefaultTreeModel(rootNode, true);
        tree.setModel(treeModel);

        JBScrollPane scrollPane = new JBScrollPane(tree);
        mainContent.add(scrollPane, BorderLayout.CENTER);
    }
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:15,代码来源:ToolWindowPanel.java

示例12: handleDoubleClickOrEnter

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
  mySubstitutionParameters.setShowContent(this);
  final LayoutTree layoutTree = (LayoutTree)tree;
  final CompositePackagingElementNode parentNode = getParentNode();
  if (parentNode != null) {
    layoutTree.addSubtreeToUpdate(parentNode);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ComplexPackagingElementNode.java

示例13: getSelected

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Nullable
private Object getSelected() {
  if (isSimpleTree()) {
    FilteringTreeStructure.FilteringNode selected = (FilteringTreeStructure.FilteringNode)((SimpleTree)myTree).getSelectedNode();
    return selected != null ? selected.getDelegate() : null;
  } else {
    final Object[] nodes = myTree.getSelectedNodes(Object.class, null);
    return nodes.length > 0 ? nodes[0] : null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FilteringTreeBuilder.java

示例14: handleDoubleClickOrEnter

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
  final Project project = getExternalProjectsView().getProject();
  ProgramRunnerUtil.executeConfiguration(project, mySettings, DefaultRunExecutor.getRunExecutorInstance());
  final RunManagerEx runManagerEx = RunManagerEx.getInstanceEx(project);
  runManagerEx.setSelectedConfiguration(mySettings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RunConfigurationNode.java

示例15: handleDoubleClickOrEnter

import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
  if (inputEvent instanceof MouseEvent) {
    inputEvent.consume();
  }
  final DomElement domElement = getDomElement();
  if (domElement.isValid()) {
    final DomElementNavigationProvider provider = DomElementsNavigationManager.getManager(domElement.getManager().getProject())
      .getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);

    provider.navigate(domElement, true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:BaseDomElementNode.java


注:本文中的com.intellij.ui.treeStructure.SimpleTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。