1 19 package org.netbeans.modules.websvc.dev.wizard.nodes; 20 21 25 import java.util.ArrayList ; 26 import java.util.Collections ; 27 import java.util.List ; 28 import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModel; 29 import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlService; 30 import org.openide.nodes.Children; 31 import org.openide.nodes.Node; 32 33 public class WsdlNodeChildren extends Children.Keys { 34 WsdlModel model; 35 36 public WsdlNodeChildren(WsdlModel model) { 37 this.model=model; 38 } 39 40 protected void addNotify() { 41 super.addNotify(); 42 updateKeys(); 43 } 44 45 protected void removeNotify() { 46 setKeys(Collections.EMPTY_SET); 47 super.removeNotify(); 48 } 49 50 private void updateKeys() { 51 List keys = model.getServices(); 52 setKeys(keys==null?new ArrayList ():keys); 53 } 54 55 protected Node[] createNodes(Object key) { 56 if(key instanceof WsdlService) { 57 return new Node[] {new ServiceNode((WsdlService)key)}; 58 } 59 return new Node[0]; 60 } 61 62 } 63 | Popular Tags |