コード例 #1
0
 private void buildCompareTree(
     CeylonOutlineNode outlineNode, DocumentRangeNode parent, IDocument document) {
   CeylonDocumentRangeNode compareNode;
   switch (outlineNode.getCategory()) {
     case ROOT_CATEGORY: // attach children of the unit node directly to our root
       compareNode =
           new CeylonDocumentRangeNode(parent, "@root", outlineNode, document) {
             @Override
             public String getName() {
               return "Ceylon Source File";
             }
           };
       break;
     case IMPORT_LIST_CATEGORY:
       compareNode = new CeylonDocumentRangeNode(parent, "@importlist", outlineNode, document);
       break;
     case DEFAULT_CATEGORY:
       compareNode =
           new CeylonDocumentRangeNode(parent, outlineNode.getIdentifier(), outlineNode, document);
       break;
     default:
       // The outline view has some extra nodes
       // we don't care about so just do nothing
       return;
   }
   for (CeylonOutlineNode treeChild : outlineNode.getChildren()) {
     buildCompareTree(treeChild, compareNode, document);
   }
   parent.addChild(compareNode);
 }