Search in sources :

Example 1 with TreeUIHelper

use of com.intellij.ui.TreeUIHelper in project intellij-community by JetBrains.

the class IntersectingLocalChangesPanel method createTree.

@NotNull
private SimpleTree createTree() {
    SimpleTree tree = new SimpleTree(TreeModelBuilder.buildFromFilePaths(myProject, true, myFiles)) {

        @Override
        protected void configureUiHelper(@NotNull TreeUIHelper helper) {
            super.configureUiHelper(helper);
            helper.installEditSourceOnDoubleClick(this);
            helper.installEditSourceOnEnterKeyHandler(this);
        }
    };
    tree.setRootVisible(false);
    tree.setShowsRootHandles(false);
    tree.setCellRenderer(new ChangesBrowserNodeRenderer(myProject, BooleanGetter.TRUE, false));
    return tree;
}
Also used : ChangesBrowserNodeRenderer(com.intellij.openapi.vcs.changes.ui.ChangesBrowserNodeRenderer) TreeUIHelper(com.intellij.ui.TreeUIHelper) SimpleTree(com.intellij.ui.treeStructure.SimpleTree) NotNull(org.jetbrains.annotations.NotNull) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with TreeUIHelper

use of com.intellij.ui.TreeUIHelper in project intellij-community by JetBrains.

the class CvsTree method init.

public void init() {
    final TreeNode root = createRoot(myProject);
    myModel = new DefaultTreeModel(root, true);
    myTree = new Tree(myModel);
    add(ScrollPaneFactory.createScrollPane(myTree), BorderLayout.CENTER);
    myTree.getSelectionModel().setSelectionMode(mySelectionMode);
    myTree.setCellRenderer(new Cvs2Renderer());
    addSelectionListener();
    final TreeUIHelper uiHelper = TreeUIHelper.getInstance();
    uiHelper.installTreeSpeedSearch(myTree);
    TreeUtil.installActions(myTree);
    IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
        IdeFocusManager.getGlobalInstance().requestFocus(myTree, true);
    });
}
Also used : TreeUIHelper(com.intellij.ui.TreeUIHelper) TreeNode(javax.swing.tree.TreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Tree(com.intellij.ui.treeStructure.Tree) DefaultTreeModel(javax.swing.tree.DefaultTreeModel)

Aggregations

TreeUIHelper (com.intellij.ui.TreeUIHelper)2 ChangesBrowserNodeRenderer (com.intellij.openapi.vcs.changes.ui.ChangesBrowserNodeRenderer)1 SimpleTree (com.intellij.ui.treeStructure.SimpleTree)1 Tree (com.intellij.ui.treeStructure.Tree)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)1 TreeNode (javax.swing.tree.TreeNode)1 NotNull (org.jetbrains.annotations.NotNull)1