1 19 20 package org.netbeans.modules.j2ee.jboss4.nodes; 21 22 import java.awt.Image ; 23 import javax.enterprise.deploy.shared.ModuleType ; 24 import javax.swing.Action ; 25 import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport; 26 import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport.ServerIcon; 27 import org.netbeans.modules.j2ee.jboss4.nodes.actions.UndeployModuleAction; 28 import org.netbeans.modules.j2ee.jboss4.nodes.actions.UndeployModuleCookieImpl; 29 import org.openide.nodes.AbstractNode; 30 import org.openide.nodes.Children; 31 import org.openide.util.Lookup; 32 import org.openide.util.actions.SystemAction; 33 34 39 public class JBEjbModuleNode extends AbstractNode { 40 41 public JBEjbModuleNode(String fileName, Lookup lookup) { 42 this(fileName, lookup, false); 43 } 44 45 public JBEjbModuleNode(String fileName, Lookup lookup, boolean isEJB3) { 46 super(Children.LEAF); 47 setDisplayName(fileName.substring(0, fileName.indexOf('.'))); 48 if (isEJB3) { 49 getCookieSet().add(new UndeployModuleCookieImpl(fileName, lookup)); 50 } 51 else { 52 getCookieSet().add(new UndeployModuleCookieImpl(fileName, ModuleType.EJB, lookup)); 53 } 54 } 55 56 public Action [] getActions(boolean context){ 57 if(getParentNode() instanceof JBEarApplicationNode) 58 return new SystemAction[] {}; 59 else 60 return new SystemAction[] { 61 SystemAction.get(UndeployModuleAction.class) 62 }; 63 } 64 65 public Image getIcon(int type) { 66 return UISupport.getIcon(ServerIcon.EJB_ARCHIVE); 67 } 68 69 public Image getOpenedIcon(int type) { 70 return getIcon(type); 71 } 72 } | Popular Tags |