1 19 package org.netbeans.modules.java.debug; 20 21 import com.sun.source.tree.AnnotationTree; 22 import com.sun.source.tree.ArrayAccessTree; 23 import com.sun.source.tree.ArrayTypeTree; 24 import com.sun.source.tree.AssertTree; 25 import com.sun.source.tree.AssignmentTree; 26 import com.sun.source.tree.BinaryTree; 27 import com.sun.source.tree.BlockTree; 28 import com.sun.source.tree.BreakTree; 29 import com.sun.source.tree.CaseTree; 30 import com.sun.source.tree.CatchTree; 31 import com.sun.source.tree.ClassTree; 32 import com.sun.source.tree.CompilationUnitTree; 33 import com.sun.source.tree.CompoundAssignmentTree; 34 import com.sun.source.tree.ConditionalExpressionTree; 35 import com.sun.source.tree.ContinueTree; 36 import com.sun.source.tree.DoWhileLoopTree; 37 import com.sun.source.tree.EmptyStatementTree; 38 import com.sun.source.tree.EnhancedForLoopTree; 39 import com.sun.source.tree.ErroneousTree; 40 import com.sun.source.tree.ExpressionStatementTree; 41 import com.sun.source.tree.ForLoopTree; 42 import com.sun.source.tree.IdentifierTree; 43 import com.sun.source.tree.IfTree; 44 import com.sun.source.tree.ImportTree; 45 import com.sun.source.tree.InstanceOfTree; 46 import com.sun.source.tree.LabeledStatementTree; 47 import com.sun.source.tree.LiteralTree; 48 import com.sun.source.tree.MemberSelectTree; 49 import com.sun.source.tree.MethodTree; 50 import com.sun.source.tree.MethodInvocationTree; 51 import com.sun.source.tree.ModifiersTree; 52 import com.sun.source.tree.NewArrayTree; 53 import com.sun.source.tree.NewClassTree; 54 import com.sun.source.tree.ParameterizedTypeTree; 55 import com.sun.source.tree.ParenthesizedTree; 56 import com.sun.source.tree.PrimitiveTypeTree; 57 import com.sun.source.tree.ReturnTree; 58 import com.sun.source.tree.SwitchTree; 59 import com.sun.source.tree.SynchronizedTree; 60 import com.sun.source.tree.ThrowTree; 61 import com.sun.source.tree.TryTree; 62 import com.sun.source.tree.TypeCastTree; 63 import com.sun.source.tree.TypeParameterTree; 64 import com.sun.source.tree.UnaryTree; 65 import com.sun.source.tree.VariableTree; 66 import com.sun.source.tree.WhileLoopTree; 67 import com.sun.source.tree.WildcardTree; 68 import com.sun.source.util.TreePath; 69 import com.sun.source.util.TreePathScanner; 70 import java.awt.Color ; 71 import java.util.ArrayList ; 72 import java.util.Collections ; 73 import java.util.List ; 74 import javax.lang.model.element.Element; 75 import javax.lang.model.type.TypeMirror; 76 import org.netbeans.api.java.source.CompilationInfo; 77 import org.netbeans.editor.Coloring; 78 import org.netbeans.modules.editor.highlights.spi.Highlight; 79 import org.openide.nodes.AbstractNode; 80 import org.openide.nodes.Children; 81 import org.openide.nodes.Node; 82 import org.openide.util.NbBundle; 83 84 88 public class TreeNode extends AbstractNode implements Highlight { 89 90 static final Coloring HIGHLIGHT = new Coloring(null, null, new Color (224, 224, 224)); 91 92 private TreePath tree; 93 private CompilationInfo info; 94 private boolean synthetic; 95 96 public static Node getTree(CompilationInfo info, TreePath tree) { 97 List <Node> result = new ArrayList <Node>(); 98 99 new FindChildrenTreeVisitor(info).scan(tree, result); 100 101 return result.get(0); 102 } 103 104 105 public TreeNode(CompilationInfo info, TreePath tree, List <Node> nodes) { 106 super(nodes.isEmpty() ? Children.LEAF: new NodeChilren(nodes)); 107 this.tree = tree; 108 this.info = info; 109 this.synthetic = info.getTreeUtilities().isSynthetic(tree); 110 setDisplayName(tree.getLeaf().getKind().toString() + ":" + tree.getLeaf().toString()); setIconBaseWithExtension("org/netbeans/modules/java/debug/resources/tree.png"); } 113 114 @Override 115 public String getHtmlDisplayName() { 116 if (synthetic) { 117 return "<html><font color='#808080'>" + translate(getDisplayName()); } 119 120 return null; 121 } 122 123 private static String [] c = new String [] {"&", "<", ">", "\""}; private static String [] tags = new String [] {"&", "<", ">", """}; 126 private String translate(String input) { 127 for (int cntr = 0; cntr < c.length; cntr++) { 128 input = input.replaceAll(c[cntr], tags[cntr]); 129 } 130 131 return input; 132 } 133 134 public int getStart() { 135 return (int)info.getTrees().getSourcePositions().getStartPosition(tree.getCompilationUnit(), tree.getLeaf()); 136 } 137 138 public int getEnd() { 139 return (int)info.getTrees().getSourcePositions().getEndPosition(tree.getCompilationUnit(), tree.getLeaf()); 140 } 141 142 public Coloring getColoring() { 143 return HIGHLIGHT; 144 } 145 146 private static final class NodeChilren extends Children.Keys { 147 148 public NodeChilren(List <Node> nodes) { 149 setKeys(nodes); 150 } 151 152 protected Node[] createNodes(Object key) { 153 return new Node[] {(Node) key}; 154 } 155 156 } 157 158 private static class FindChildrenTreeVisitor extends TreePathScanner<Void , List <Node>> { 159 160 private CompilationInfo info; 161 162 public FindChildrenTreeVisitor(CompilationInfo info) { 163 this.info = info; 164 } 165 166 @Override 167 public Void visitAnnotation(AnnotationTree tree, List <Node> d) { 168 List <Node> below = new ArrayList <Node>(); 169 170 addCorrespondingElement(below); 172 addCorrespondingType(below); 173 addCorrespondingComments(below); 174 175 super.visitAnnotation(tree, below); 176 177 d.add(new TreeNode(info, getCurrentPath(), below)); 178 return null; 179 } 180 181 @Override 182 public Void visitMethodInvocation(MethodInvocationTree tree, List <Node> d) { 183 List <Node> below = new ArrayList <Node>(); 184 185 addCorrespondingElement(below); 186 addCorrespondingType(below); 187 addCorrespondingComments(below); 188 189 super.visitMethodInvocation(tree, below); 190 191 d.add(new TreeNode(info, getCurrentPath(), below)); 192 return null; 193 } 194 195 @Override 196 public Void visitAssert(AssertTree tree, List <Node> d) { 197 List <Node> below = new ArrayList <Node>(); 198 199 addCorrespondingType(below); 200 addCorrespondingComments(below); 201 super.visitAssert(tree, below); 202 203 d.add(new TreeNode(info, getCurrentPath(), below)); 204 return null; 205 } 206 207 @Override 208 public Void visitAssignment(AssignmentTree tree, List <Node> d) { 209 List <Node> below = new ArrayList <Node>(); 210 211 addCorrespondingType(below); 212 addCorrespondingComments(below); 213 super.visitAssignment(tree, below); 214 215 d.add(new TreeNode(info, getCurrentPath(), below)); 216 return null; 217 } 218 219 @Override 220 public Void visitCompoundAssignment(CompoundAssignmentTree tree, List <Node> d) { 221 List <Node> below = new ArrayList <Node>(); 222 223 addCorrespondingType(below); 224 addCorrespondingComments(below); 225 super.visitCompoundAssignment(tree, below); 226 227 d.add(new TreeNode(info, getCurrentPath(), below)); 228 return null; 229 } 230 231 @Override 232 public Void visitBinary(BinaryTree tree, List <Node> d) { 233 List <Node> below = new ArrayList <Node>(); 234 235 addCorrespondingType(below); 236 addCorrespondingComments(below); 237 super.visitBinary(tree, below); 238 239 d.add(new TreeNode(info, getCurrentPath(), below)); 240 return null; 241 } 242 243 @Override 244 public Void visitBlock(BlockTree tree, List <Node> d) { 245 List <Node> below = new ArrayList <Node>(); 246 247 addCorrespondingType(below); 248 addCorrespondingComments(below); 249 super.visitBlock(tree, below); 250 251 d.add(new TreeNode(info, getCurrentPath(), below)); 252 return null; 253 } 254 255 @Override 256 public Void visitBreak(BreakTree tree, List <Node> d) { 257 List <Node> below = new ArrayList <Node>(); 258 259 addCorrespondingType(below); 260 addCorrespondingComments(below); 261 super.visitBreak(tree, below); 262 263 d.add(new TreeNode(info, getCurrentPath(), below)); 264 return null; 265 } 266 267 @Override 268 public Void visitCase(CaseTree tree, List <Node> d) { 269 List <Node> below = new ArrayList <Node>(); 270 271 addCorrespondingType(below); 272 addCorrespondingComments(below); 273 super.visitCase(tree, below); 274 275 d.add(new TreeNode(info, getCurrentPath(), below)); 276 return null; 277 } 278 279 @Override 280 public Void visitCatch(CatchTree tree, List <Node> d) { 281 List <Node> below = new ArrayList <Node>(); 282 283 addCorrespondingType(below); 284 addCorrespondingComments(below); 285 super.visitCatch(tree, below); 286 287 d.add(new TreeNode(info, getCurrentPath(), below)); 288 return null; 289 } 290 291 @Override 292 public Void visitClass(ClassTree tree, List <Node> d) { 293 List <Node> below = new ArrayList <Node>(); 294 295 addCorrespondingElement(below); 296 addCorrespondingType(below); 297 addCorrespondingComments(below); 298 299 super.visitClass(tree, below); 300 301 d.add(new TreeNode(info, getCurrentPath(), below)); 302 return null; 303 } 304 305 @Override 306 public Void visitConditionalExpression(ConditionalExpressionTree tree, List <Node> d) { 307 List <Node> below = new ArrayList <Node>(); 308 309 addCorrespondingType(below); 310 addCorrespondingComments(below); 311 super.visitConditionalExpression(tree, below); 312 313 d.add(new TreeNode(info, getCurrentPath(), below)); 314 return null; 315 } 316 317 @Override 318 public Void visitContinue(ContinueTree tree, List <Node> d) { 319 List <Node> below = new ArrayList <Node>(); 320 321 addCorrespondingType(below); 322 addCorrespondingComments(below); 323 super.visitContinue(tree, below); 324 325 d.add(new TreeNode(info, getCurrentPath(), below)); 326 return null; 327 } 328 329 @Override 330 public Void visitDoWhileLoop(DoWhileLoopTree tree, List <Node> d) { 331 List <Node> below = new ArrayList <Node>(); 332 333 addCorrespondingType(below); 334 addCorrespondingComments(below); 335 super.visitDoWhileLoop(tree, below); 336 337 d.add(new TreeNode(info, getCurrentPath(), below)); 338 return null; 339 } 340 341 @Override 342 public Void visitErroneous(ErroneousTree tree, List <Node> d) { 343 List <Node> below = new ArrayList <Node>(); 344 345 addCorrespondingType(below); 346 addCorrespondingComments(below); 347 scan(((com.sun.tools.javac.tree.JCTree.JCErroneous)tree).errs, below); 348 349 d.add(new TreeNode(info, getCurrentPath(), below)); 350 return null; 351 } 352 353 @Override 354 public Void visitExpressionStatement(ExpressionStatementTree tree, List <Node> d) { 355 List <Node> below = new ArrayList <Node>(); 356 357 addCorrespondingType(below); 358 addCorrespondingComments(below); 359 super.visitExpressionStatement(tree, below); 360 361 d.add(new TreeNode(info, getCurrentPath(), below)); 362 return null; 363 } 364 365 @Override 366 public Void visitEnhancedForLoop(EnhancedForLoopTree tree, List <Node> d) { 367 List <Node> below = new ArrayList <Node>(); 368 369 addCorrespondingType(below); 370 addCorrespondingComments(below); 371 super.visitEnhancedForLoop(tree, below); 372 373 d.add(new TreeNode(info, getCurrentPath(), below)); 374 return null; 375 } 376 377 @Override 378 public Void visitForLoop(ForLoopTree tree, List <Node> d) { 379 List <Node> below = new ArrayList <Node>(); 380 381 addCorrespondingType(below); 382 addCorrespondingComments(below); 383 super.visitForLoop(tree, below); 384 385 d.add(new TreeNode(info, getCurrentPath(), below)); 386 return null; 387 } 388 389 @Override 390 public Void visitIdentifier(IdentifierTree tree, List <Node> d) { 391 List <Node> below = new ArrayList <Node>(); 392 393 addCorrespondingElement(below); 394 addCorrespondingType(below); 395 addCorrespondingComments(below); 396 397 super.visitIdentifier(tree, below); 398 399 d.add(new TreeNode(info, getCurrentPath(), below)); 400 return null; 401 } 402 403 @Override 404 public Void visitIf(IfTree tree, List <Node> d) { 405 List <Node> below = new ArrayList <Node>(); 406 407 addCorrespondingType(below); 408 addCorrespondingComments(below); 409 super.visitIf(tree, below); 410 411 d.add(new TreeNode(info, getCurrentPath(), below)); 412 return null; 413 } 414 415 @Override 416 public Void visitImport(ImportTree tree, List <Node> d) { 417 List <Node> below = new ArrayList <Node>(); 418 419 addCorrespondingType(below); 420 addCorrespondingComments(below); 421 super.visitImport(tree, below); 422 423 d.add(new TreeNode(info, getCurrentPath(), below)); 424 return null; 425 } 426 427 @Override 428 public Void visitArrayAccess(ArrayAccessTree tree, List <Node> d) { 429 List <Node> below = new ArrayList <Node>(); 430 431 addCorrespondingType(below); 432 addCorrespondingComments(below); 433 super.visitArrayAccess(tree, below); 434 435 d.add(new TreeNode(info, getCurrentPath(), below)); 436 return null; 437 } 438 439 @Override 440 public Void visitLabeledStatement(LabeledStatementTree tree, List <Node> d) { 441 List <Node> below = new ArrayList <Node>(); 442 443 addCorrespondingType(below); 444 addCorrespondingComments(below); 445 super.visitLabeledStatement(tree, below); 446 447 d.add(new TreeNode(info, getCurrentPath(), below)); 448 return null; 449 } 450 451 @Override 452 public Void visitLiteral(LiteralTree tree, List <Node> d) { 453 List <Node> below = new ArrayList <Node>(); 454 455 addCorrespondingType(below); 456 addCorrespondingComments(below); 457 super.visitLiteral(tree, below); 458 459 d.add(new TreeNode(info, getCurrentPath(), below)); 460 return null; 461 } 462 463 @Override 464 public Void visitMethod(MethodTree tree, List <Node> d) { 465 List <Node> below = new ArrayList <Node>(); 466 467 addCorrespondingElement(below); 468 addCorrespondingType(below); 469 addCorrespondingComments(below); 470 471 super.visitMethod(tree, below); 472 473 d.add(new TreeNode(info, getCurrentPath(), below)); 474 return null; 475 } 476 477 @Override 478 public Void visitModifiers(ModifiersTree tree, List <Node> d) { 479 List <Node> below = new ArrayList <Node>(); 480 481 addCorrespondingType(below); 482 addCorrespondingComments(below); 483 super.visitModifiers(tree, below); 484 485 d.add(new TreeNode(info, getCurrentPath(), below)); 486 return null; 487 } 488 489 @Override 490 public Void visitNewArray(NewArrayTree tree, List <Node> d) { 491 List <Node> below = new ArrayList <Node>(); 492 493 addCorrespondingElement(below); 494 addCorrespondingType(below); 495 addCorrespondingComments(below); 496 497 super.visitNewArray(tree, below); 498 499 d.add(new TreeNode(info, getCurrentPath(), below)); 500 return null; 501 } 502 503 @Override 504 public Void visitNewClass(NewClassTree tree, List <Node> d) { 505 List <Node> below = new ArrayList <Node>(); 506 507 addCorrespondingElement(below); 508 addCorrespondingType(below); 509 addCorrespondingComments(below); 510 511 super.visitNewClass(tree, below); 512 513 d.add(new TreeNode(info, getCurrentPath(), below)); 514 return null; 515 } 516 517 @Override 518 public Void visitParenthesized(ParenthesizedTree tree, List <Node> d) { 519 List <Node> below = new ArrayList <Node>(); 520 521 addCorrespondingType(below); 522 addCorrespondingComments(below); 523 super.visitParenthesized(tree, below); 524 525 d.add(new TreeNode(info, getCurrentPath(), below)); 526 return null; 527 } 528 529 @Override 530 public Void visitReturn(ReturnTree tree, List <Node> d) { 531 List <Node> below = new ArrayList <Node>(); 532 533 addCorrespondingType(below); 534 addCorrespondingComments(below); 535 super.visitReturn(tree, below); 536 537 d.add(new TreeNode(info, getCurrentPath(), below)); 538 return null; 539 } 540 541 @Override 542 public Void visitMemberSelect(MemberSelectTree tree, List <Node> d) { 543 List <Node> below = new ArrayList <Node>(); 544 545 addCorrespondingElement(below); 546 addCorrespondingType(below); 547 addCorrespondingComments(below); 548 549 super.visitMemberSelect(tree, below); 550 551 d.add(new TreeNode(info, getCurrentPath(), below)); 552 return null; 553 } 554 555 @Override 556 public Void visitEmptyStatement(EmptyStatementTree tree, List <Node> d) { 557 List <Node> below = new ArrayList <Node>(); 558 559 addCorrespondingType(below); 560 addCorrespondingComments(below); 561 super.visitEmptyStatement(tree, below); 562 563 d.add(new TreeNode(info, getCurrentPath(), below)); 564 return null; 565 } 566 567 @Override 568 public Void visitSwitch(SwitchTree tree, List <Node> d) { 569 List <Node> below = new ArrayList <Node>(); 570 571 addCorrespondingType(below); 572 addCorrespondingComments(below); 573 super.visitSwitch(tree, below); 574 575 d.add(new TreeNode(info, getCurrentPath(), below)); 576 return null; 577 } 578 579 @Override 580 public Void visitSynchronized(SynchronizedTree tree, List <Node> d) { 581 List <Node> below = new ArrayList <Node>(); 582 583 addCorrespondingType(below); 584 addCorrespondingComments(below); 585 super.visitSynchronized(tree, below); 586 587 d.add(new TreeNode(info, getCurrentPath(), below)); 588 return null; 589 } 590 591 @Override 592 public Void visitThrow(ThrowTree tree, List <Node> d) { 593 List <Node> below = new ArrayList <Node>(); 594 595 addCorrespondingType(below); 596 addCorrespondingComments(below); 597 super.visitThrow(tree, below); 598 599 d.add(new TreeNode(info, getCurrentPath(), below)); 600 return null; 601 } 602 603 @Override 604 public Void visitCompilationUnit(CompilationUnitTree tree, List <Node> d) { 605 List <Node> below = new ArrayList <Node>(); 606 607 addCorrespondingElement(below); 608 addCorrespondingType(below); 609 addCorrespondingComments(below); 610 611 super.visitCompilationUnit(tree, below); 612 613 d.add(new TreeNode(info, getCurrentPath(), below)); 614 return null; 615 } 616 617 @Override 618 public Void visitTry(TryTree tree, List <Node> d) { 619 List <Node> below = new ArrayList <Node>(); 620 621 addCorrespondingType(below); 622 addCorrespondingComments(below); 623 super.visitTry(tree, below); 624 625 d.add(new TreeNode(info, getCurrentPath(), below)); 626 return null; 627 } 628 629 @Override 630 public Void visitParameterizedType(ParameterizedTypeTree tree, List <Node> d) { 631 List <Node> below = new ArrayList <Node>(); 632 633 addCorrespondingElement(below); 634 addCorrespondingType(below); 635 addCorrespondingComments(below); 636 637 super.visitParameterizedType(tree, below); 638 639 d.add(new TreeNode(info, getCurrentPath(), below)); 640 return null; 641 } 642 643 @Override 644 public Void visitArrayType(ArrayTypeTree tree, List <Node> d) { 645 List <Node> below = new ArrayList <Node>(); 646 647 addCorrespondingElement(below); 648 addCorrespondingType(below); 649 addCorrespondingComments(below); 650 651 super.visitArrayType(tree, below); 652 653 d.add(new TreeNode(info, getCurrentPath(), below)); 654 return null; 655 } 656 657 @Override 658 public Void visitTypeCast(TypeCastTree tree, List <Node> d) { 659 List <Node> below = new ArrayList <Node>(); 660 661 addCorrespondingType(below); 662 addCorrespondingComments(below); 663 super.visitTypeCast(tree, below); 664 665 d.add(new TreeNode(info, getCurrentPath(), below)); 666 return null; 667 } 668 669 @Override 670 public Void visitPrimitiveType(PrimitiveTypeTree tree, List <Node> d) { 671 List <Node> below = new ArrayList <Node>(); 672 673 addCorrespondingType(below); 674 addCorrespondingComments(below); 675 super.visitPrimitiveType(tree, below); 676 677 d.add(new TreeNode(info, getCurrentPath(), below)); 678 return null; 679 } 680 681 @Override 682 public Void visitTypeParameter(TypeParameterTree tree, List <Node> d) { 683 List <Node> below = new ArrayList <Node>(); 684 685 addCorrespondingElement(below); 686 addCorrespondingType(below); 687 addCorrespondingComments(below); 688 689 super.visitTypeParameter(tree, below); 690 691 d.add(new TreeNode(info, getCurrentPath(), below)); 692 return null; 693 } 694 695 @Override 696 public Void visitInstanceOf(InstanceOfTree tree, List <Node> d) { 697 List <Node> below = new ArrayList <Node>(); 698 699 addCorrespondingType(below); 700 addCorrespondingComments(below); 701 super.visitInstanceOf(tree, below); 702 703 d.add(new TreeNode(info, getCurrentPath(), below)); 704 return null; 705 } 706 707 @Override 708 public Void visitUnary(UnaryTree tree, List <Node> d) { 709 List <Node> below = new ArrayList <Node>(); 710 711 addCorrespondingType(below); 712 addCorrespondingComments(below); 713 super.visitUnary(tree, below); 714 715 d.add(new TreeNode(info, getCurrentPath(), below)); 716 return null; 717 } 718 719 @Override 720 public Void visitVariable(VariableTree tree, List <Node> d) { 721 List <Node> below = new ArrayList <Node>(); 722 723 addCorrespondingElement(below); 724 addCorrespondingType(below); 725 addCorrespondingComments(below); 726 727 super.visitVariable(tree, below); 728 729 d.add(new TreeNode(info, getCurrentPath(), below)); 730 return null; 731 } 732 733 @Override 734 public Void visitWhileLoop(WhileLoopTree tree, List <Node> d) { 735 List <Node> below = new ArrayList <Node>(); 736 737 addCorrespondingType(below); 738 addCorrespondingComments(below); 739 super.visitWhileLoop(tree, below); 740 741 d.add(new TreeNode(info, getCurrentPath(), below)); 742 return null; 743 } 744 745 @Override 746 public Void visitWildcard(WildcardTree tree, List <Node> d) { 747 List <Node> below = new ArrayList <Node>(); 748 749 addCorrespondingType(below); 750 addCorrespondingComments(below); 751 super.visitWildcard(tree, below); 752 753 d.add(new TreeNode(info, getCurrentPath(), below)); 754 return null; 755 } 756 757 private void addCorrespondingElement(List <Node> below) { 758 Element el = info.getTrees().getElement(getCurrentPath()); 759 760 if (el != null) { 761 below.add(new ElementNode(info, el, Collections.EMPTY_LIST)); 762 } else { 763 below.add(new NotFoundElementNode(NbBundle.getMessage(TreeNode.class, "Cannot_Resolve_Element"))); 764 } 765 } 766 767 private void addCorrespondingType(List <Node> below) { 768 TypeMirror tm = info.getTrees().getTypeMirror(getCurrentPath()); 769 770 if (tm != null) { 771 below.add(new TypeNode(tm)); 772 } else { 773 below.add(new NotFoundTypeNode(NbBundle.getMessage(TreeNode.class, "Cannot_Resolve_Type"))); 774 } 775 } 776 777 private void addCorrespondingComments(List <Node> below) { 778 below.add(new CommentsNode(NbBundle.getMessage(TreeNode.class, "NM_Preceding_Comments"), info.getTreeUtilities().getComments(getCurrentPath().getLeaf(), true))); 779 below.add(new CommentsNode(NbBundle.getMessage(TreeNode.class, "NM_Trailing_Comments"), info.getTreeUtilities().getComments(getCurrentPath().getLeaf(), false))); 780 } 781 } 782 783 private static class NotFoundElementNode extends AbstractNode { 784 785 public NotFoundElementNode(String name) { 786 super(Children.LEAF); 787 setName(name); 788 setDisplayName(name); 789 setIconBaseWithExtension("org/netbeans/modules/java/debug/resources/element.png"); } 791 792 } 793 794 private static class TypeNode extends AbstractNode { 795 796 public TypeNode(TypeMirror type) { 797 super(Children.LEAF); 798 setDisplayName(type.getKind().toString() + ":" + type.toString()); setIconBaseWithExtension("org/netbeans/modules/java/debug/resources/type.png"); } 801 802 } 803 804 private static class NotFoundTypeNode extends AbstractNode { 805 806 public NotFoundTypeNode(String name) { 807 super(Children.LEAF); 808 setName(name); 809 setDisplayName(name); 810 setIconBaseWithExtension("org/netbeans/modules/java/debug/resources/type.png"); } 812 813 } 814 } 815 | Popular Tags |