1 19 20 package org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres; 21 22 import javax.swing.Action ; 23 import org.netbeans.modules.j2ee.spi.ejbjar.EjbNodesFactory; 24 import org.openide.nodes.Children; 25 import org.openide.nodes.FilterNode; 26 import org.openide.nodes.Node; 27 28 32 public class EjbChildren extends Children.Array { 33 private final Node projectNode; 34 35 36 public EjbChildren(Node projectNode) { 37 this.projectNode = projectNode; 38 } 39 40 protected void addNotify() { 41 super.addNotify(); 42 Node ejbsNode = projectNode.getChildren().findChild(EjbNodesFactory.CONTAINER_NODE_NAME); 43 if (ejbsNode != null) { 45 Node[] ejbNodes = ejbsNode.getChildren().getNodes(true); 46 Node[] filteredNodes = new Node[ejbNodes.length]; 47 for (int i =0; i < ejbNodes.length; i++) { 48 filteredNodes[i] = new FilterNode(ejbNodes[i], Children.LEAF) { 49 public Action [] getActions(boolean context) { 50 return new Action [0]; 51 } 52 }; 53 } 54 add(filteredNodes); 55 } 56 } 57 58 } 59 | Popular Tags |