1 19 package org.netbeans.modules.j2ee.sun.ide.runtime.nodes; 20 21 22 import javax.swing.Action ; 23 import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtActiveNode; 24 import org.netbeans.modules.j2ee.sun.ide.controllers.DeployedItemsController; 25 import org.netbeans.modules.j2ee.sun.ide.controllers.EnablerController; 26 import org.netbeans.modules.j2ee.sun.bridge.apis.Controller; 27 import org.netbeans.modules.j2ee.sun.bridge.apis.Enableable; 28 import org.netbeans.modules.j2ee.sun.bridge.apis.Undeployable; 29 import org.netbeans.modules.j2ee.sun.ide.controllers.J2EEServerMgmtController; 30 import org.netbeans.modules.j2ee.sun.ide.runtime.actions.EnableDisableAction; 31 import org.netbeans.modules.j2ee.sun.ide.runtime.actions.UndeployAction; 32 import org.openide.actions.PropertiesAction; 33 import org.openide.nodes.Children; 34 import org.openide.util.actions.SystemAction; 35 36 37 41 public abstract class AppserverMgmtApplicationsNode 42 extends AppserverMgmtActiveNode implements Undeployable, Enableable { 43 44 45 protected boolean isEmbedded; 46 47 48 51 public AppserverMgmtApplicationsNode(final Children children, 52 final Controller controller, final String type, 53 final boolean isEmbedded) { 54 super(children, controller, type); 55 this.isEmbedded = isEmbedded; 56 } 57 58 59 60 61 68 public Action [] getActions(boolean flag) { 69 if(!isEmbedded) { 70 return new SystemAction[] { 71 SystemAction.get(UndeployAction.class), 72 SystemAction.get(EnableDisableAction.class), 73 SystemAction.get(PropertiesAction.class) 74 }; 75 } else { 76 return new SystemAction[] { 77 SystemAction.get(PropertiesAction.class) 78 }; 79 } 80 } 81 82 83 90 protected java.util.Map getSheetProperties() { 91 return getController().getProperties(getPropertiesToIgnore()); 92 } 93 94 95 106 public javax.management.Attribute setSheetProperty(String attrName, Object value) { 107 try { 108 return getController().setProperty(attrName, value); 109 } catch (RuntimeException rex) { 110 return null; 111 } 112 } 113 114 115 119 public J2EEServerMgmtController getJ2EEServerMgmtController() { 120 return getAppserverMgmtController().getJ2EEServerMgmtController(); 121 } 122 123 124 128 public void undeploy() { 129 ((DeployedItemsController)getController()).undeploy(); 130 } 131 132 133 137 public boolean isEnabled() { 138 return ((EnablerController)getController()).isEnabled(); 139 } 140 141 142 146 public void setEnabled(boolean enabled) { 147 ((EnablerController)getController()).setEnabled(enabled); 148 } 149 150 } 151 | Popular Tags |