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


Java SimpleTree.setRootVisible方法代码示例

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


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

示例1: 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

示例2: 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

示例3: CapturesToolWindow

import com.intellij.ui.treeStructure.SimpleTree; //导入方法依赖的package包/类
public CapturesToolWindow(@NotNull final Project project) {

    myProject = project;
    DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode());
    myTree = new SimpleTree(model);
    myTree.setRootVisible(false);

    myStructure = new CapturesTreeStructure(myProject);
    myBuilder = new AbstractTreeBuilder(myTree, model, myStructure, null);
    Disposer.register(this, myBuilder);
    Disposer.register(project, this);

    myBuilder.initRootNode();
    myBuilder.getInitialized().doWhenDone(new Runnable() {
      @Override
      public void run() {
        myBuilder.getUi().expandAll(null);
      }
    });

    myTree.addHierarchyListener(this);
    CaptureService.getInstance(myProject).addListener(this);

    CaptureService.getInstance(myProject).update();
    myStructure.update();

    myTree.setPopupGroup(getPopupActions(), "Context");
    myTree.putClientProperty(DataManager.CLIENT_PROPERTY_DATA_PROVIDER, this);
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:CapturesToolWindow.java

示例4: AtomController

import com.intellij.ui.treeStructure.SimpleTree; //导入方法依赖的package包/类
public AtomController(@NotNull Project project, @NotNull JBScrollPane scrollPane) {
  scrollPane.getHorizontalScrollBar().setUnitIncrement(20);
  scrollPane.getVerticalScrollBar().setUnitIncrement(20);
  myTree = new SimpleTree();
  myTree.setRowHeight(TreeUtil.TREE_ROW_HEIGHT);
  myTree.setRootVisible(false);
  myTree.setLineStyleAngled();
  myTree.getEmptyText().setText(SELECT_CAPTURE);
  myLoadingPanel = new JBLoadingPanel(new BorderLayout(), project);
  myLoadingPanel.add(myTree);
  scrollPane.setViewportView(myLoadingPanel);
  myAtomTreeRenderer = new AtomTreeRenderer();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AtomController.java

示例5: StateController

import com.intellij.ui.treeStructure.SimpleTree; //导入方法依赖的package包/类
public StateController(@NotNull GfxTraceEditor editor, @NotNull JBScrollPane scrollPane) {
  myEditor = editor;
  myTree = new SimpleTree();
  myTree.setRowHeight(TreeUtil.TREE_ROW_HEIGHT);
  myTree.setRootVisible(false);
  myTree.setCellRenderer(new StateTreeRenderer());
  myTree.getEmptyText().setText(SELECT_CAPTURE);
  myLoadingPanel = new JBLoadingPanel(new BorderLayout(), editor.getProject());
  myLoadingPanel.add(myTree);
  scrollPane.setViewportView(myLoadingPanel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:StateController.java

示例6: JahiaTreeStructure

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

示例7: GenerateByPatternDialog

import com.intellij.ui.treeStructure.SimpleTree; //导入方法依赖的package包/类
public GenerateByPatternDialog(Project project, PatternDescriptor[] descriptors) {
  super(project);
  myProject = project;
  setTitle("Generate by Pattern");
  setOKButtonText("Generate");

  myMap = new MultiMap<String, PatternDescriptor>();
  for (PatternDescriptor descriptor : descriptors) {
    myMap.putValue(descriptor.getParentId(), descriptor);
  }
  DefaultMutableTreeNode root = createNode(null);

  myTree = new SimpleTree() {

  };
  myTree.setRootVisible(false);
  myTree.setCellRenderer(new DefaultTreeCellRenderer() {
    @NotNull
    @Override
    public Component getTreeCellRendererComponent(@NotNull JTree tree,
                                                  Object value,
                                                  boolean sel,
                                                  boolean expanded,
                                                  boolean leaf,
                                                  int row,
                                                  boolean hasFocus) {
      Component component = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row,

                                                                         hasFocus);
      Object object = ((DefaultMutableTreeNode)value).getUserObject();
      if (object instanceof PatternDescriptor) {
        setText(((PatternDescriptor)object).getName());
        setIcon(((PatternDescriptor)object).getIcon());
      }
      return component;
    }
  });

  myTree.setModel(new DefaultTreeModel(root));
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(@NotNull TreeSelectionEvent e) {
      update();
    }
  });
  myEditor = TemplateEditorUtil.createEditor(true, "");

  mySplitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myTree));
  JPanel details = new JPanel(new BorderLayout());
  details.add(myEditor.getComponent(), BorderLayout.CENTER);
  mySplitter.setSecondComponent(details);
  mySplitter.setHonorComponentsMinimumSize(true);
  mySplitter.setShowDividerControls(true);

  myTree.setSelectionRow(0);

  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:59,代码来源:GenerateByPatternDialog.java

示例8: GenerateByPatternDialog

import com.intellij.ui.treeStructure.SimpleTree; //导入方法依赖的package包/类
public GenerateByPatternDialog(Project project, PatternDescriptor[] descriptors, DataContext context) {
  super(project);
  setTitle("Generate by Pattern");
  setOKButtonText("Generate");

  myMap = new MultiMap<String, PatternDescriptor>();
  for (PatternDescriptor descriptor : descriptors) {
    myMap.putValue(descriptor.getParentId(), descriptor);
  }
  DefaultMutableTreeNode root = createNode(null);

  myTree = new SimpleTree() {

  };
  myTree.setRootVisible(false);
  myTree.setCellRenderer(new DefaultTreeCellRenderer() {
    @Override
    public Component getTreeCellRendererComponent(JTree tree,
                                                  Object value,
                                                  boolean sel,
                                                  boolean expanded,
                                                  boolean leaf,
                                                  int row,
                                                  boolean hasFocus) {
      Component component = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row,

                                                                         hasFocus);
      Object object = ((DefaultMutableTreeNode)value).getUserObject();
      if (object instanceof PatternDescriptor) {
        setText(((PatternDescriptor)object).getName());
        setIcon(((PatternDescriptor)object).getIcon());
      }
      return component;
    }
  });

  myTree.setModel(new DefaultTreeModel(root));
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      update();
    }
  });
  myEditor = TemplateEditorUtil.createEditor(true, "");

  mySplitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myTree));
  JPanel details = new JPanel(new BorderLayout());
  details.add(myEditor.getComponent(), BorderLayout.CENTER);
  mySplitter.setSecondComponent(details);
  mySplitter.setHonorComponentsMinimumSize(true);
  mySplitter.setShowDividerControls(true);

  myTree.setSelectionRow(0);

  init();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:57,代码来源:GenerateByPatternDialog.java

示例9: getComponent

import com.intellij.ui.treeStructure.SimpleTree; //导入方法依赖的package包/类
@NotNull
@Override
public JComponent getComponent()
{
	DefaultMutableTreeNode root = new DefaultMutableTreeNode();

	for(CSharpAssemblyBlock block : myBlocks)
	{
		DefaultMutableTreeNode newChild = new DefaultMutableTreeNode(block);

		root.add(newChild);
	}

	final SimpleTree simpleTree = new SimpleTree(new DefaultTreeModel(root));
	simpleTree.setRootVisible(false);
	simpleTree.setCellRenderer(new ColoredTreeCellRenderer()
	{
		@RequiredDispatchThread
		@Override
		public void customizeCellRenderer(JTree jTree, Object o, boolean b, boolean b2, boolean b3, int i, boolean b4)
		{
			Object object = ((DefaultMutableTreeNode) o).getUserObject();
			if(object instanceof CSharpAssemblyBlock)
			{
				append(((CSharpAssemblyBlock) object).getTitle());
			}
		}
	});

	final OnePixelSplitter splitter = new OnePixelSplitter();
	simpleTree.addTreeSelectionListener(new TreeSelectionListener()
	{
		@Override
		public void valueChanged(TreeSelectionEvent e)
		{
			List<CSharpAssemblyBlock> cSharpAssemblyBlocks = TreeUtil.collectSelectedObjectsOfType(simpleTree, CSharpAssemblyBlock.class);

			CSharpAssemblyBlock firstItem = ContainerUtil.getFirstItem(cSharpAssemblyBlocks);
			if(firstItem == null)
			{
				splitter.setSecondComponent(new JPanel());
			}
			else
			{

				splitter.setSecondComponent(firstItem.createAndLoadComponent(myPsiFile, !myIsReadonlyFile));
			}
		}
	});

	splitter.setAndLoadSplitterProportionKey("CSharpAssemblyFileEditor");

	splitter.setFirstComponent(simpleTree);
	splitter.setSecondComponent(new JPanel());

	return ScrollPaneFactory.createScrollPane(splitter);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:58,代码来源:CSharpAssemblyFileEditor.java


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