1 19 20 package org.netbeans.modules.websvc.registry.nodes; 21 22 import org.openide.actions.*; 23 import org.openide.nodes.*; 24 import org.openide.util.HelpCtx; 25 import org.openide.util.NbBundle; 26 import org.openide.util.Utilities; 27 import org.openide.util.actions.SystemAction; 28 29 import org.netbeans.modules.websvc.registry.actions.*; 30 import org.netbeans.modules.websvc.registry.model.WebServiceGroup; 31 import org.netbeans.modules.websvc.registry.model.WebServiceListModel; 32 import java.awt.Image ; 33 import java.io.IOException ; 34 import java.util.Iterator ; 35 import javax.swing.Action ; 36 37 41 public class WebServiceGroupNode extends AbstractNode implements WebServiceGroupCookie { 42 WebServiceGroup websvcGroup; 43 44 public WebServiceGroupNode(WebServiceGroup wsGroup) { 45 super(new WebServiceGroupNodeChildren(wsGroup)); 46 websvcGroup = wsGroup; 47 setIconBaseWithExtension("org/netbeans/modules/websvc/registry/resources/folder.png"); 48 49 getCookieSet().add(this); 50 } 51 52 public WebServiceGroup getWebServiceGroup() { 53 return websvcGroup; 54 } 55 56 public boolean canRename() { 57 return true; 58 } 59 60 public String getName() { 61 return websvcGroup.getName(); 62 } 63 64 public void setName(String name){ 65 websvcGroup.setName(name); 66 setDisplayName(name); 67 this.fireDisplayNameChange(name,null); 68 } 69 70 78 public Action[] getActions(boolean context) { 79 return new SystemAction[] { 80 SystemAction.get(AddWebServiceAction.class), 81 SystemAction.get(DeleteWebServiceGroupAction.class), 82 SystemAction.get(RenameAction.class) 83 }; 84 } 85 86 public boolean canDestroy() { 87 return true; 88 } 89 90 public void destroy() throws IOException { 91 WebServiceListModel wsListModel = WebServiceListModel.getInstance(); 92 97 wsListModel.removeWebServiceGroup(websvcGroup.getId()); 98 super.destroy(); 99 } 100 101 public HelpCtx getHelpCtx() { 102 return new HelpCtx("websvcGroupNode"); 103 } 104 } 105 | Popular Tags |