1 19 20 package org.netbeans.modules.apisupport.beanbrowser; 21 22 import org.openide.nodes.AbstractNode; 23 import org.openide.nodes.FilterNode; 24 import org.openide.nodes.FilterNode.Children; 25 import org.openide.nodes.Node; 26 import org.openide.util.HelpCtx; 27 28 29 public class Wrapper extends FilterNode { 30 31 private Wrapper(Node orig) { 32 super(orig, new WrapperKids(orig)); 33 } 34 35 38 public static Node make(Node orig) { 39 if (orig instanceof Wrapper) { 40 org.openide.nodes.Children kids = new Children.Array(); 42 kids.add(new Node[] { orig.cloneNode() }); 43 AbstractNode toret = new AbstractNode(kids) { 44 public HelpCtx getHelpCtx() { 45 return new HelpCtx("org.netbeans.modules.apisupport.beanbrowser"); 46 } 47 }; 48 toret.setName("Already a wrapper node..."); 49 toret.setIconBaseWithExtension("org/netbeans/modules/apisupport/beanbrowser/BeanBrowserIcon.gif"); 50 return toret; 51 } else { 52 return new Wrapper(orig); 53 } 54 } 55 56 public Node cloneNode() { 57 return new Wrapper(getOriginal()); 58 } 59 60 79 80 } 81 | Popular Tags |