1 19 package org.netbeans.modules.j2ee.sun.ide.runtime.nodes; 20 21 import javax.swing.Action ; 22 23 import java.util.List ; 24 import java.util.Arrays ; 25 import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtLeafNode; 26 import org.netbeans.modules.j2ee.sun.bridge.apis.Removable; 27 28 import org.openide.actions.*; 29 import org.openide.util.actions.SystemAction; 30 31 import org.netbeans.modules.j2ee.sun.ide.runtime.actions.DeleteResourceAction; 32 import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtController; 33 import org.netbeans.modules.j2ee.sun.util.NodeTypes; 34 35 36 41 public abstract class ResourceLeafNode extends AppserverMgmtLeafNode 42 implements Removable { 43 44 private String resourceName; 45 46 47 53 public ResourceLeafNode(final AppserverMgmtController controller, 54 final String nodeType, final String resName) { 55 super(controller, nodeType); 56 this.resourceName = resName; 57 setDisplayName(resName); 58 } 59 60 61 62 63 64 71 public Action [] getActions(boolean flag) { 72 return new SystemAction[] { 73 SystemAction.get(DeleteResourceAction.class), 74 SystemAction.get(PropertiesAction.class) 75 }; 76 } 77 78 79 82 protected String getResourceName() { 83 return this.resourceName; 84 } 85 86 87 91 abstract public void remove(); 92 93 protected List getPropertiesToIgnore() { 94 return Arrays.asList(NodeTypes.SERVER_RESOURCE_NODES); 95 } 96 97 106 public void updateExtraProperty(Object [] props, java.util.Map oldProps) { 107 getAppserverMgmtController(). 108 updateResourceExtraProperty(getResourceName(), getNodeType(), props, oldProps); 109 } 110 111 } 112 | Popular Tags |