1 19 20 package org.netbeans.modules.xml.multiview.ui; 21 import org.openide.nodes.NodeAdapter; 22 23 27 public class SectionContainerNode extends org.openide.nodes.AbstractNode { 28 29 30 public SectionContainerNode(org.openide.nodes.Children ch) { 31 super(ch); 32 int childrenSize = ch.getNodes().length; 33 setIconBase("org/netbeans/modules/xml/multiview/resources/folder"); addNodeListener(new NodeAdapter() { 35 public void childrenAdded(org.openide.nodes.NodeMemberEvent ev) { 36 if (SectionContainerNode.this.getChildren().getNodes().length==1) { 37 firePropertyChange(org.openide.nodes.Node.PROP_LEAF,Boolean.TRUE, Boolean.FALSE); 38 } 39 } 40 public void childrenRemoved(org.openide.nodes.NodeMemberEvent ev) { 41 if (SectionContainerNode.this.getChildren().getNodes().length==0) { 42 firePropertyChange(org.openide.nodes.Node.PROP_LEAF,Boolean.FALSE, Boolean.TRUE); 43 } 44 } 45 }); 46 } 47 48 public org.openide.util.HelpCtx getHelpCtx() { 49 return new org.openide.util.HelpCtx(getName()); 50 } 51 } 52 | Popular Tags |