1 19 20 24 25 package org.netbeans.modules.j2ee.sun.ws7.nodes.actions; 26 import org.openide.nodes.Node; 27 import org.openide.util.HelpCtx; 28 import org.openide.util.NbBundle; 29 import org.openide.util.actions.NodeAction; 30 import org.netbeans.modules.j2ee.sun.ws7.nodes.WS70WebModule; 31 import org.netbeans.modules.j2ee.sun.ws7.nodes.WS70WebModuleNode; 32 import org.netbeans.modules.j2ee.sun.ws7.nodes.WS70WebModulesRootNode; 33 import org.netbeans.modules.j2ee.sun.ws7.ui.Util; 34 35 39 public class UndeployAction extends NodeAction{ 40 41 42 public UndeployAction() { 43 } 44 protected void performAction(Node[] nodes){ 45 Node parentNode = nodes[0].getParentNode(); 46 WS70WebModuleNode node = (WS70WebModuleNode)nodes[0].getCookie(WS70WebModuleNode.class); 47 WS70WebModule module = (WS70WebModule)nodes[0].getCookie(WS70WebModule.class); 48 try{ 49 module.undeploy(); 50 }catch(Exception ex){ 51 Util.showError(ex.getMessage()); 52 return; 53 } 54 WS70WebModulesRootNode moduleRootNode = (WS70WebModulesRootNode)parentNode.getCookie(WS70WebModulesRootNode.class); 55 if(moduleRootNode!=null){ 56 moduleRootNode.refresh(); 57 } 58 } 59 60 protected boolean enable(Node[] nodes){ 61 return nodes.length==1; 62 } 63 64 public String getName(){ 65 return NbBundle.getMessage(UndeployAction.class, "LBL_UndeployModuleAction"); 66 } 67 68 public HelpCtx getHelpCtx(){ 69 return HelpCtx.DEFAULT_HELP; 70 } 71 } 72 | Popular Tags |