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


Java AllTodosTreeBuilder类代码示例

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


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

示例1: testToDo1

import com.intellij.ide.todo.AllTodosTreeBuilder; //导入依赖的package包/类
public void testToDo1() throws Exception {
   AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), new DefaultTreeModel(new DefaultMutableTreeNode()), myProject);
   all.init();

   AbstractTreeStructure structure = all.getTreeStructure();
   ((TodoTreeStructure)structure).setFlattenPackages(true);
   ProjectViewTestUtil.assertStructureEqual(structure,
                                            "Root\n" +
                                            " Summary\n" +
                                            "  package2 toDoFileCount=1,toDoItemCount=2\n" +
                                            "   JavaClass.java\n" +
                                            "    Item: (62,78)\n" +
                                            "    Item: (145,162)\n",
                                            myPrintInfo);

   checkOccurrences(all, new String[]{"Item: (62,78)", "Item: (145,162)"});
   Disposer.dispose(all);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ToDoTreeStructureTest.java

示例2: testToDo

import com.intellij.ide.todo.AllTodosTreeBuilder; //导入依赖的package包/类
public void testToDo() throws Exception {
  AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), new DefaultTreeModel(new DefaultMutableTreeNode()), myProject);
  all.init();

  AbstractTreeStructure structure = all.getTreeStructure();
  ProjectViewTestUtil.assertStructureEqual(structure,
                                           "Root\n" +
                                           " Summary\n" +
                                           "  toDo\n" +
                                           "   xmlFile.xml\n" +
                                           "    Item: (12,16)\n" +
                                           "  package1 toDoFileCount=2,toDoItemCount=4\n" +
                                           "   package2 toDoFileCount=1,toDoItemCount=2\n" +
                                           "    JavaClass.java\n" +
                                           "     Item: (62,78)\n" +
                                           "     Item: (145,162)\n" +
                                           "   JavaClass.java\n" +
                                           "    Item: (52,68)\n" +
                                           "    Item: (134,151)\n" +
                                           "  package3 toDoFileCount=1,toDoItemCount=2\n" +
                                           "   JavaClass.java\n" +
                                           "    Item: (53,69)\n" +
                                           "    Item: (136,153)\n", myPrintInfo);

  checkOccurrences(all, new String[]{"Item: (12,16)", "Item: (62,78)", "Item: (145,162)", "Item: (52,68)", "Item: (134,151)",
    "Item: (53,69)", "Item: (136,153)"});


  final DefaultTreeModel treeModel = new DefaultTreeModel(new DefaultMutableTreeNode());
  final JTree currentFileTree = new Tree(treeModel);
  CurrentFileTodosTreeBuilder builder = new CurrentFileTodosTreeBuilder(currentFileTree,
                                                                        treeModel,
                                                                        myProject);

  builder.init();
  builder.setFile(getSrcDirectory().findSubdirectory("package1").findFile("JavaClass.java"));
  builder.updateFromRoot();
  ProjectViewTestUtil.assertStructureEqual(builder.getTreeStructure(),
                                           "JavaClass.java\n" +
                                           " JavaClass.java\n" +
                                           "  Item: (52,68)\n" +
                                           "  Item: (134,151)\n", myPrintInfo);


  Disposer.dispose(builder);
  Disposer.dispose(all);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:ToDoTreeStructureTest.java


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