1 19 package org.netbeans.modules.j2ee.sun.ide.runtime.nodes; 20 21 import java.util.List ; 22 import java.util.Arrays ; 23 24 import javax.swing.Action ; 25 import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtLeafNode; 26 import org.openide.util.actions.SystemAction; 27 28 import org.netbeans.modules.j2ee.sun.ide.controllers.AppClientModuleController; 29 import org.netbeans.modules.j2ee.sun.ide.controllers.DeployedItemsController; 30 import org.netbeans.modules.j2ee.sun.util.NodeTypes; 31 import org.netbeans.modules.j2ee.sun.ide.runtime.actions.UndeployAction; 32 import org.netbeans.modules.j2ee.sun.bridge.apis.Undeployable; 33 import org.openide.actions.PropertiesAction; 34 35 36 37 38 40 public class AppClientModuleNode extends AppserverMgmtLeafNode 41 implements Undeployable { 42 43 private static String NODE_TYPE = NodeTypes.APP_CLIENT_MODULE; 44 private String appClientName; 45 private boolean isEmbedded; 46 47 48 49 50 54 public AppClientModuleNode(AppClientModuleController controller) { 55 super(controller,NODE_TYPE); 56 this.appClientName = controller.getName(); 57 setDisplayName(appClientName); 58 } 59 60 61 65 public AppClientModuleNode(final AppClientModuleController controller, 66 final boolean isEmbedded) { 67 super(controller,NODE_TYPE); 68 this.appClientName = controller.getName(); 69 this.isEmbedded = isEmbedded; 70 setDisplayName(appClientName); 71 72 } 73 74 public AppClientModuleNode(final String name) { 75 super(NODE_TYPE); 76 this.isEmbedded = true; 77 setDisplayName(name); 78 } 79 80 87 public Action [] getActions(boolean flag) { 88 if(!isEmbedded) { 89 return new SystemAction[] { 90 SystemAction.get(UndeployAction.class), 91 SystemAction.get(PropertiesAction.class) 92 }; 93 } else { 94 return new SystemAction[] { 95 SystemAction.get(PropertiesAction.class) 96 }; 97 } 98 } 99 100 101 107 protected java.util.Map getSheetProperties() { 108 return getController().getProperties(getPropertiesToIgnore()); 109 } 110 111 112 123 public javax.management.Attribute setSheetProperty(String attrName, Object value) { 124 return getController().setProperty(attrName, value); 125 } 126 127 128 132 public void undeploy() { 133 ((DeployedItemsController)getController()).undeploy(); 134 } 135 136 protected List getPropertiesToIgnore() { 137 return Arrays.asList(NodeTypes.APP_CLIENT_MODULES_NODE); 138 } 139 } 140 | Popular Tags |