本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}