Java 类com.intellij.ui.TreeSpeedSearch 实例源码

项目:intellij-ce-playground    文件:BreakpointsCheckboxTree.java   
@Override
protected void installSpeedSearch() {
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath path) {
      Object node = path.getLastPathComponent();
      if (node instanceof BreakpointItemNode) {
        return ((BreakpointItemNode)node).getBreakpointItem().speedSearchText();
      }
      else if (node instanceof BreakpointsGroupNode) {
        return ((BreakpointsGroupNode)node).getGroup().getName();
      }
      return "";
    }
  });
}
项目:intellij-ce-playground    文件:ChangesListView.java   
public ChangesListView(final Project project) {
  myProject = project;

  getModel().setRoot(ChangesBrowserNode.create(myProject, TreeModelBuilder.ROOT_NODE_VALUE));

  setShowsRootHandles(true);
  setRootVisible(false);
  setDragEnabled(true);

  new TreeSpeedSearch(this, new NodeToTextConvertor());
  SmartExpander.installOn(this);
  myCopyProvider = new ChangesBrowserNodeCopyProvider(this);
  new TreeLinkMouseListener(new ChangesBrowserNodeRenderer(myProject, false, false)).installOn(this);

  myNodeRenderer = new ChangesBrowserNodeRenderer(project, false, true);
  myShowFlattenNodeRenderer = new ChangesBrowserNodeRenderer(project, true, true);
}
项目:intellij-ce-playground    文件:LiveTemplateTree.java   
@Override
protected void installSpeedSearch() {
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath o) {
      Object object = ((DefaultMutableTreeNode)o.getLastPathComponent()).getUserObject();
      if (object instanceof TemplateGroup) {
        return ((TemplateGroup)object).getName();
      }
      if (object instanceof TemplateImpl) {
        TemplateImpl template = (TemplateImpl)object;
        return StringUtil.notNullize(template.getGroupName()) + " " +
               StringUtil.notNullize(template.getKey()) + " " +
               StringUtil.notNullize(template.getDescription()) + " " +
               template.getTemplateText();
      }
      return "";
    }
  }, true);
}
项目:intellij-ce-playground    文件:ContentEntryTreeEditor.java   
public ContentEntryTreeEditor(Project project, List<ModuleSourceRootEditHandler<?>> editHandlers) {
  myProject = project;
  myEditHandlers = editHandlers;
  myTree = new Tree();
  myTree.setRootVisible(true);
  myTree.setShowsRootHandles(true);

  myEditingActionsGroup = new DefaultActionGroup();

  TreeUtil.installActions(myTree);
  new TreeSpeedSearch(myTree);

  myTreePanel = new MyPanel(new BorderLayout());
  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
  myTreePanel.add(scrollPane, BorderLayout.CENTER);

  myTreePanel.setVisible(false);
  myDescriptor = FileChooserDescriptorFactory.createMultipleFoldersDescriptor();
  myDescriptor.setShowFileSystemRoots(false);
}
项目:intellij-ce-playground    文件:FileTemplateTabAsTree.java   
protected FileTemplateTabAsTree(String title) {
  super(title);
  myRoot = initModel();
  MyTreeModel treeModel = new MyTreeModel(myRoot);
  myTree = new Tree(treeModel);
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(myTree);

  myTree.expandPath(TreeUtil.getPathFromRoot(myRoot));
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myTree.setCellRenderer(new MyTreeCellRenderer());
  myTree.expandRow(0);

  myTree.addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      onTemplateSelected();
    }
  });
  new TreeSpeedSearch(myTree);
}
项目:intellij-ce-playground    文件:ScopeChooserConfigurable.java   
@Override
protected void initTree() {
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      final TreePath path = e.getOldLeadSelectionPath();
      if (path != null) {
        final MyNode node = (MyNode)path.getLastPathComponent();
        final NamedConfigurable namedConfigurable = node.getConfigurable();
        if (namedConfigurable instanceof ScopeConfigurable) {
          ((ScopeConfigurable)namedConfigurable).cancelCurrentProgress();
        }
      }
    }
  });
  super.initTree();
  myTree.setShowsRootHandles(false);
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);

  myTree.getEmptyText().setText(IdeBundle.message("scopes.no.scoped"));
}
项目:intellij-ce-playground    文件:DirectoryChooserModuleTreeView.java   
public DirectoryChooserModuleTreeView(@NotNull Project project) {
  myRootNode = new DefaultMutableTreeNode();
  myTree = new Tree(myRootNode);
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  myProject = project;
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  myTree.setCellRenderer(new MyTreeCellRenderer());
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath o) {
      final Object userObject = ((DefaultMutableTreeNode)o.getLastPathComponent()).getUserObject();
      if (userObject instanceof Module) {
        return ((Module)userObject).getName();
      }
      else {
        if (userObject == null) return "";
        return userObject.toString();
      }
    }
  }, true);
}
项目:intellij-ce-playground    文件:ConfigFilesTreeBuilder.java   
public static void installSearch(JTree tree) {
  new TreeSpeedSearch(tree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      final Object object = ((DefaultMutableTreeNode)treePath.getLastPathComponent()).getUserObject();
      if (object instanceof Module) {
        return ((Module)object).getName();
      }
      else if (object instanceof PsiFile) {
        return ((PsiFile)object).getName();
      }
      else if (object instanceof VirtualFile) {
        return ((VirtualFile)object).getName();
      }
      else {
        return "";
      }
    }
  });
}
项目:intellij-ce-playground    文件:RepositoryBrowserComponent.java   
private void createComponent() {
  setLayout(new BorderLayout());
  myRepositoryTree = new Tree();
  myRepositoryTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myRepositoryTree.setRootVisible(false);
  myRepositoryTree.setShowsRootHandles(true);
  JScrollPane scrollPane =
    ScrollPaneFactory.createScrollPane(myRepositoryTree, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  add(scrollPane, BorderLayout.CENTER);
  myRepositoryTree.setCellRenderer(new SvnRepositoryTreeCellRenderer());
  TreeSpeedSearch search = new TreeSpeedSearch(myRepositoryTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath o) {
      Object component = o.getLastPathComponent();
      if (component instanceof RepositoryTreeNode) {
        return ((RepositoryTreeNode)component).getURL().toDecodedString();
      }
      return null;
    }
  });
  search.setComparator(new SpeedSearchComparator(false, true));

  EditSourceOnDoubleClickHandler.install(myRepositoryTree);
}
项目:tools-idea    文件:ContentEntryTreeEditor.java   
public ContentEntryTreeEditor(Project project, boolean canMarkSources, boolean canMarkTestSources) {
  myProject = project;
  myCanMarkSources = canMarkSources;
  myCanMarkTestSources = canMarkTestSources;
  myTree = new Tree();
  myTree.setRootVisible(true);
  myTree.setShowsRootHandles(true);

  myEditingActionsGroup = new DefaultActionGroup();

  TreeUtil.installActions(myTree);
  new TreeSpeedSearch(myTree);

  myTreePanel = new MyPanel(new BorderLayout());
  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
  myTreePanel.add(new ToolbarPanel(scrollPane, myEditingActionsGroup), BorderLayout.CENTER);

  myTreePanel.setVisible(false);
  myDescriptor = FileChooserDescriptorFactory.createMultipleFoldersDescriptor();
  myDescriptor.setShowFileSystemRoots(false);
}
项目:tools-idea    文件:FileTemplateTabAsTree.java   
protected FileTemplateTabAsTree(String title) {
  super(title);
  myRoot = initModel();
  MyTreeModel treeModel = new MyTreeModel(myRoot);
  myTree = new Tree(treeModel);
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(myTree);

  myTree.expandPath(TreeUtil.getPathFromRoot(myRoot));
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myTree.setCellRenderer(new MyTreeCellRenderer());
  myTree.expandRow(0);

  myTree.addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      onTemplateSelected();
    }
  });
  new TreeSpeedSearch(myTree);
}
项目:tools-idea    文件:ScopeChooserConfigurable.java   
@Override
protected void initTree() {
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      final TreePath path = e.getOldLeadSelectionPath();
      if (path != null) {
        final MyNode node = (MyNode)path.getLastPathComponent();
        final NamedConfigurable namedConfigurable = node.getConfigurable();
        if (namedConfigurable instanceof ScopeConfigurable) {
          ((ScopeConfigurable)namedConfigurable).cancelCurrentProgress();
        }
      }
    }
  });
  super.initTree();
  myTree.setShowsRootHandles(false);
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);

  myTree.getEmptyText().setText(IdeBundle.message("scopes.no.scoped"));
}
项目:tools-idea    文件:DirectoryChooserModuleTreeView.java   
public DirectoryChooserModuleTreeView(@NotNull Project project) {
  myRootNode = new DefaultMutableTreeNode();
  myTree = new Tree(myRootNode);
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  myProject = project;
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  myTree.setCellRenderer(new MyTreeCellRenderer());
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath o) {
      final Object userObject = ((DefaultMutableTreeNode)o.getLastPathComponent()).getUserObject();
      if (userObject instanceof Module) {
        return ((Module)userObject).getName();
      }
      else {
        if (userObject == null) return "";
        return userObject.toString();
      }
    }
  }, true);
}
项目:tools-idea    文件:ConfigFilesTreeBuilder.java   
public static void installSearch(JTree tree) {
  new TreeSpeedSearch(tree, new Convertor<TreePath, String>() {
    public String convert(final TreePath treePath) {
      final Object object = ((DefaultMutableTreeNode)treePath.getLastPathComponent()).getUserObject();
      if (object instanceof Module) {
        return ((Module)object).getName();
      }
      else if (object instanceof PsiFile) {
        return ((PsiFile)object).getName();
      }
      else if (object instanceof VirtualFile) {
        return ((VirtualFile)object).getName();
      }
      else {
        return "";
      }
    }
  });
}
项目:tools-idea    文件:RepositoryBrowserComponent.java   
private void createComponent() {
  setLayout(new BorderLayout());
  myRepositoryTree = new Tree();
  myRepositoryTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myRepositoryTree.setRootVisible(false);
  myRepositoryTree.setShowsRootHandles(true);
  JScrollPane scrollPane =
    ScrollPaneFactory.createScrollPane(myRepositoryTree, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  add(scrollPane, BorderLayout.CENTER);
  myRepositoryTree.setCellRenderer(new SvnRepositoryTreeCellRenderer());
  TreeSpeedSearch search = new TreeSpeedSearch(myRepositoryTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath o) {
      Object component = o.getLastPathComponent();
      if (component instanceof RepositoryTreeNode) {
        return ((RepositoryTreeNode)component).getURL().toDecodedString();
      }
      return null;
    }
  });
  search.setComparator(new SpeedSearchComparator(false, true));

  EditSourceOnDoubleClickHandler.install(myRepositoryTree);
}
项目:consulo    文件:ChangesListView.java   
public ChangesListView(@Nonnull Project project) {
  myProject = project;

  setModel(TreeModelBuilder.buildEmpty(project));

  setShowsRootHandles(true);
  setRootVisible(false);
  setDragEnabled(true);

  myCopyProvider = new ChangesBrowserNodeCopyProvider(this);

  ChangesBrowserNodeRenderer renderer = new ChangesBrowserNodeRenderer(project, () -> myShowFlatten, true);
  setCellRenderer(renderer);

  new TreeSpeedSearch(this, TO_TEXT_CONVERTER);
  SmartExpander.installOn(this);
  new TreeLinkMouseListener(renderer).installOn(this);
}
项目:consulo    文件:ContentEntryTreeEditor.java   
public ContentEntryTreeEditor(Project project, ModuleConfigurationState state) {
  myProject = project;
  myState = state;
  myTree = new Tree();
  myTree.setRootVisible(true);
  myTree.setShowsRootHandles(true);

  myEditingActionsGroup = new DefaultActionGroup();

  TreeUtil.installActions(myTree);
  new TreeSpeedSearch(myTree);

  myTreePanel = new MyPanel(new BorderLayout());
  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
  myTreePanel.add(scrollPane, BorderLayout.CENTER);

  myTreePanel.setVisible(false);
  myDescriptor = FileChooserDescriptorFactory.createMultipleFoldersDescriptor();
  myDescriptor.setShowFileSystemRoots(false);
}
项目:consulo    文件:FileTemplateTabAsTree.java   
protected FileTemplateTabAsTree(String title) {
  super(title);
  myRoot = initModel();
  myTreeModel = new MyTreeModel(myRoot);
  myTree = new Tree(myTreeModel);
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(myTree);

  myTree.expandPath(TreeUtil.getPathFromRoot(myRoot));
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myTree.setCellRenderer(new MyTreeCellRenderer());
  myTree.expandRow(0);

  myTree.addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      onTemplateSelected();
    }
  });
  new TreeSpeedSearch(myTree);
}
项目:consulo    文件:ScopeChooserConfigurable.java   
@Override
protected void initTree() {
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      final TreePath path = e.getOldLeadSelectionPath();
      if (path != null) {
        final MyNode node = (MyNode)path.getLastPathComponent();
        final NamedConfigurable namedConfigurable = node.getConfigurable();
        if (namedConfigurable instanceof ScopeConfigurable) {
          ((ScopeConfigurable)namedConfigurable).cancelCurrentProgress();
        }
      }
    }
  });
  super.initTree();
  myTree.setShowsRootHandles(false);
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);

  myTree.getEmptyText().setText(IdeBundle.message("scopes.no.scoped"));
}
项目:consulo    文件:DirectoryChooserModuleTreeView.java   
public DirectoryChooserModuleTreeView(@Nonnull Project project) {
  myRootNode = new DefaultMutableTreeNode();
  myTree = new Tree(myRootNode);
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  myProject = project;
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  myTree.setCellRenderer(new MyTreeCellRenderer());
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath o) {
      final Object userObject = ((DefaultMutableTreeNode)o.getLastPathComponent()).getUserObject();
      if (userObject instanceof Module) {
        return ((Module)userObject).getName();
      }
      else {
        if (userObject == null) return "";
        return userObject.toString();
      }
    }
  }, true);
}
项目:consulo-xml    文件:ConfigFilesTreeBuilder.java   
public static void installSearch(JTree tree) {
  new TreeSpeedSearch(tree, new Convertor<TreePath, String>() {
    public String convert(final TreePath treePath) {
      final Object object = ((DefaultMutableTreeNode)treePath.getLastPathComponent()).getUserObject();
      if (object instanceof Module) {
        return ((Module)object).getName();
      }
      else if (object instanceof PsiFile) {
        return ((PsiFile)object).getName();
      }
      else if (object instanceof VirtualFile) {
        return ((VirtualFile)object).getName();
      }
      else {
        return "";
      }
    }
  });
}
项目:consulo-java    文件:CyclicDependenciesPanel.java   
private void initTree(final MyTree tree) {
  tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  tree.setCellRenderer(new MyTreeCellRenderer(tree == myLeftTree));
  tree.setRootVisible(false);
  tree.setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(tree);

  TreeUtil.installActions(tree);
  SmartExpander.installOn(tree);
  EditSourceOnDoubleClickHandler.install(tree);
  new TreeSpeedSearch(tree);

  PopupHandler.installUnknownPopupHandler(tree, createTreePopupActions(), ActionManager.getInstance());


}
项目:intellij-ce-playground    文件:BaseStructureConfigurable.java   
@Override
protected void initTree() {
  if (myWasTreeInitialized) return;
  myWasTreeInitialized = true;

  super.initTree();
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);
  ToolTipManager.sharedInstance().registerComponent(myTree);
  myTree.setCellRenderer(new ProjectStructureElementRenderer(myContext));
}
项目:intellij-ce-playground    文件:LayoutTree.java   
@Override
protected void configureUiHelper(TreeUIHelper helper) {
  final Convertor<TreePath, String> convertor = new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath path) {
      final SimpleNode node = getNodeFor(path);
      if (node instanceof PackagingElementNode) {
        return ((PackagingElementNode<?>)node).getElementPresentation().getSearchName();
      }
      return "";
    }
  };
  new TreeSpeedSearch(this, convertor, true);
}
项目:intellij-ce-playground    文件:ProjectJdksConfigurable.java   
@Override
protected void initTree() {
  super.initTree();
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);

  myTree.setRootVisible(false);
}
项目:intellij-ce-playground    文件:RemoteServerListConfigurable.java   
@Override
protected void initTree() {
  super.initTree();
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);
}
项目:intellij-ce-playground    文件:InspectionTree.java   
public InspectionTree(@NotNull Project project, @NotNull GlobalInspectionContextImpl context) {
  super(new InspectionRootNode(project));
  myContext = context;

  setCellRenderer(new CellRenderer());
  setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(this);
  addTreeWillExpandListener(new ExpandListener());

  myExpandedUserObjects = new HashSet<Object>();
  myExpandedUserObjects.add(project);

  TreeUtil.installActions(this);
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath o) {
      return InspectionsConfigTreeComparator.getDisplayTextToSort(o.getLastPathComponent().toString());
    }
  });

  addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      TreePath newSelection = e.getNewLeadSelectionPath();
      if (newSelection != null) {
        mySelectionPath = new SelectionPath(newSelection);
      }
    }
  });
}
项目:intellij-ce-playground    文件:ColorOptionsTree.java   
public ColorOptionsTree(@NotNull String categoryName) {
  super(createTreeModel());
  myTreeModel = (DefaultTreeModel)getModel();
  setRootVisible(false);
  getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myCategoryName = categoryName;
  new TreeSpeedSearch(this, TreeSpeedSearch.NODE_DESCRIPTOR_TOSTRING, true);
}
项目:intellij-ce-playground    文件:HierarchyBrowserBase.java   
protected void configureTree(@NotNull Tree tree) {
  tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  tree.setToggleClickCount(-1);
  tree.setCellRenderer(new HierarchyNodeRenderer());
  UIUtil.setLineStyleAngled(tree);
  new TreeSpeedSearch(tree);
  TreeUtil.installActions(tree);
  myAutoScrollToSourceHandler.install(tree);
}
项目:ultimate-pastebin-intellij-plugin    文件:ToolWindowServiceImpl.java   
public ToolWindowServiceImpl() {
  pasteBinService = ServiceManager.getService(PasteBinService.class);
  pasteBinConfigurationService = ServiceManager.getService(PasteBinConfigurationService.class);

  DefaultMutableTreeNode root = new DefaultMutableTreeNode();
  this.userNode = new DefaultMutableTreeNode(new UserNode(null));
  this.trendsNode = new DefaultMutableTreeNode(new TrendPasteNode());

  // This nodes always will be present
  root.add(userNode);
  root.add(trendsNode);

  // Initialize the tree
  this.tree = new Tree(new ListTreeTableModel(root, null));

  // Disable root node
  // and show the root children
  this.tree.setRootVisible(false);
  this.tree.setShowsRootHandles(true);

  // Enable speed search for tree of paste notes
  new TreeSpeedSearch(tree);

  // Tree render for putting icons
  this.tree.setCellRenderer(new PasteTreeRenderer());

  // Sets the right click context menu
  CustomizationUtil.installPopupHandler(tree, "ultimatepastebin.ToolwindowPopupMenu", ActionPlaces.TFS_TREE_POPUP);
}
项目:vso-intellij    文件:TfsTreeForm.java   
public TfsTreeForm() {
    DataManager.registerDataProvider(tree, this);
    new TreeSpeedSearch(tree);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent e) {
            selectedItem = doGetSelectedItem();
            pathField.setText(selectedItem != null ? selectedItem.path : null);
            eventDispatcher.getMulticaster().selectionChanged();
        }
    });
    PopupHandler.installPopupHandler(tree, POPUP_ACTION_GROUP, ActionPlaces.REMOTE_HOST_DIALOG_POPUP);
    setMessage(null, false);
}
项目:tools-idea    文件:BaseStructureConfigurable.java   
@Override
protected void initTree() {
  if (myWasTreeInitialized) return;
  myWasTreeInitialized = true;

  super.initTree();
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);
  ToolTipManager.sharedInstance().registerComponent(myTree);
  myTree.setCellRenderer(new ProjectStructureElementRenderer(myContext));
}
项目:tools-idea    文件:LayoutTree.java   
@Override
protected void configureUiHelper(TreeUIHelper helper) {
  final Convertor<TreePath, String> convertor = new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath path) {
      final SimpleNode node = getNodeFor(path);
      if (node instanceof PackagingElementNode) {
        return ((PackagingElementNode<?>)node).getElementPresentation().getSearchName();
      }
      return "";
    }
  };
  new TreeSpeedSearch(this, convertor, true);
}
项目:tools-idea    文件:ProjectJdksConfigurable.java   
@Override
protected void initTree() {
  super.initTree();
  new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
    }
  }, true);

  myTree.setRootVisible(false);
}
项目:tools-idea    文件:FrameworksTree.java   
@Override
protected void installSpeedSearch() {
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath path) {
      final Object node = path.getLastPathComponent();
      if (node instanceof FrameworkSupportNodeBase) {
        return ((FrameworkSupportNodeBase)node).getTitle();
      }
      return "";
    }
  });
}
项目:tools-idea    文件:TestTreeView.java   
protected void installHandlers() {
  EditSourceOnDoubleClickHandler.install(this);
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    public String convert(final TreePath path) {
      final AbstractTestProxy testProxy = getSelectedTest(path);
      if (testProxy == null) return null;
      return testProxy.getName();
    }
  });
  TreeUtil.installActions(this);
  PopupHandler.installPopupHandler(this, IdeActions.GROUP_TESTTREE_POPUP, ActionPlaces.TESTTREE_VIEW_POPUP);
  ViewAssertEqualsDiffAction.registerShortcut(this);
}
项目:tools-idea    文件:ChangesListView.java   
public ChangesListView(final Project project) {
  myProject = project;

  getModel().setRoot(ChangesBrowserNode.create(myProject, TreeModelBuilder.ROOT_NODE_VALUE));

  setShowsRootHandles(true);
  setRootVisible(false);

  new TreeSpeedSearch(this, new NodeToTextConvertor());
  SmartExpander.installOn(this);
  myCopyProvider = new TreeCopyProvider(this);
  new TreeLinkMouseListener(new ChangesBrowserNodeRenderer(myProject, false, false)).installOn(this);
}
项目:tools-idea    文件:InspectionTree.java   
public InspectionTree(@NotNull Project project, @NotNull GlobalInspectionContextImpl context) {
  super(new InspectionRootNode(project));
  myContext = context;

  setCellRenderer(new CellRenderer());
  setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(this);
  addTreeWillExpandListener(new ExpandListener());

  myExpandedUserObjects = new HashSet<Object>();
  myExpandedUserObjects.add(project);

  TreeUtil.installActions(this);
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath o) {
      return InspectionsConfigTreeComparator.getDisplayTextToSort(o.getLastPathComponent().toString());
    }
  });

  addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      TreePath newSelection = e.getNewLeadSelectionPath();
      if (newSelection != null) {
        mySelectionPath = new SelectionPath(newSelection);
      }
    }
  });
}
项目:tools-idea    文件:HierarchyBrowserBase.java   
protected void configureTree(@NotNull Tree tree) {
  tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  tree.setToggleClickCount(-1);
  tree.setCellRenderer(new HierarchyNodeRenderer());
  UIUtil.setLineStyleAngled(tree);
  new TreeSpeedSearch(tree);
  TreeUtil.installActions(tree);
  myAutoScrollToSourceHandler.install(tree);
}
项目:consulo    文件:InspectionTree.java   
public InspectionTree(@Nonnull Project project, @Nonnull GlobalInspectionContextImpl context) {
  super(new InspectionRootNode(project));
  myContext = context;

  setCellRenderer(new CellRenderer());
  setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(this);
  addTreeWillExpandListener(new ExpandListener());

  myExpandedUserObjects = new HashSet<Object>();
  myExpandedUserObjects.add(project);

  TreeUtil.installActions(this);
  new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
    @Override
    public String convert(TreePath o) {
      return InspectionsConfigTreeComparator.getDisplayTextToSort(o.getLastPathComponent().toString());
    }
  });

  addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      TreePath newSelection = e.getNewLeadSelectionPath();
      if (newSelection != null) {
        mySelectionPath = new SelectionPath(newSelection);
      }
    }
  });
}