1 19 20 23 24 package org.netbeans.modules.j2ee.sun.ws7.nodes; 25 import javax.enterprise.deploy.spi.DeploymentManager ; 26 import javax.enterprise.deploy.spi.Target ; 27 import javax.swing.Action ; 28 29 import org.openide.nodes.AbstractNode; 30 import org.openide.nodes.Node; 31 import org.openide.nodes.Children; 32 import org.openide.util.Lookup; 33 import org.openide.nodes.Sheet; 34 import org.openide.util.actions.SystemAction; 35 import org.openide.actions.PropertiesAction; 36 import org.netbeans.modules.j2ee.sun.ws7.nodes.actions.DeleteResourceAction; 37 38 42 public class WS70ResourceNode extends AbstractNode implements Node.Cookie{ 43 44 private WS70Resource resource; 45 48 public WS70ResourceNode(WS70Resource res) { 49 super(Children.LEAF); 50 this.resource = res; 51 setDisplayName(resource.getJndiName()); 52 getCookieSet().add(resource); 53 setIconBaseWithExtension("org/netbeans/modules/j2ee/sun/ws7/resources/ResourceIcon.gif"); 54 } 55 public Action getPreferredAction() { 56 return SystemAction.get(PropertiesAction.class); 57 } 58 public Action [] getActions(boolean context) { 59 return new SystemAction[] { 60 SystemAction.get(DeleteResourceAction.class), 61 SystemAction.get(PropertiesAction.class) 62 }; 63 } 64 public Sheet createSheet() { 65 Sheet sheet = Sheet.createDefault(); 66 Sheet.Set ssProp = sheet.get (Sheet.PROPERTIES); 68 if (ssProp == null) { 69 ssProp = Sheet.createPropertiesSet (); 70 sheet.put (ssProp); 71 } 72 return resource.updateSheet(sheet); 73 } 74 } 75 | Popular Tags |