1 19 package org.netbeans.modules.j2ee.sun.ide.runtime.nodes; 20 21 import javax.swing.Action ; 22 23 24 import org.openide.util.actions.SystemAction; 25 26 import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtController; 27 import org.netbeans.modules.j2ee.sun.ide.runtime.actions.DeleteResourceAction; 28 import org.netbeans.modules.j2ee.sun.util.NodeTypes; 29 import org.openide.actions.PropertiesAction; 30 31 35 public class JDBCResourceNode extends ResourceLeafNode { 36 37 private static final String NODE_TYPE = NodeTypes.JDBC_RESOURCE; 38 39 45 public JDBCResourceNode(final AppserverMgmtController controller, 46 final String jdbcName) { 47 super(controller, NODE_TYPE, jdbcName); 48 } 49 50 51 58 public Action [] getActions(boolean flag) { 59 if(getResourceName().equals("jdbc/__TimerPool")) { 60 return new SystemAction[] { 61 SystemAction.get(PropertiesAction.class) 62 }; 63 } else { 64 return new SystemAction[] { 65 SystemAction.get(DeleteResourceAction.class), 66 SystemAction.get(PropertiesAction.class) 67 }; 68 } 69 } 70 71 72 77 protected java.util.Map getSheetProperties() { 78 return getAppserverMgmtController(). 79 getJDBCResourceProperties(getResourceName(), 80 getPropertiesToIgnore()); 81 82 } 83 84 85 96 public javax.management.Attribute setSheetProperty(String attrName, Object value) { 97 return getAppserverMgmtController(). 98 setJDBCResourceProperty(getResourceName(), attrName, value); 99 } 100 101 104 public void remove() { 105 getAppserverMgmtController(). 106 deleteJDBCResource(getResourceName()); 107 } 108 109 } 110 | Popular Tags |