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


Java TreeSpeedSearch类代码示例

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


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

示例1: installSpeedSearch

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
@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 "";
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BreakpointsCheckboxTree.java

示例2: ChangesListView

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ChangesListView.java

示例3: installSpeedSearch

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
@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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:LiveTemplateTree.java

示例4: ContentEntryTreeEditor

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ContentEntryTreeEditor.java

示例5: FileTemplateTabAsTree

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:FileTemplateTabAsTree.java

示例6: initTree

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
@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"));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ScopeChooserConfigurable.java

示例7: DirectoryChooserModuleTreeView

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DirectoryChooserModuleTreeView.java

示例8: installSearch

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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 "";
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ConfigFilesTreeBuilder.java

示例9: createComponent

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RepositoryBrowserComponent.java

示例10: ContentEntryTreeEditor

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:ContentEntryTreeEditor.java

示例11: installSearch

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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 "";
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ConfigFilesTreeBuilder.java

示例12: ChangesListView

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:ChangesListView.java

示例13: ContentEntryTreeEditor

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:ContentEntryTreeEditor.java

示例14: FileTemplateTabAsTree

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:FileTemplateTabAsTree.java

示例15: DirectoryChooserModuleTreeView

import com.intellij.ui.TreeSpeedSearch; //导入依赖的package包/类
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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:DirectoryChooserModuleTreeView.java


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