1 19 20 21 package org.netbeans.modules.tomcat5.nodes.actions; 22 23 import org.openide.nodes.Node; 24 import org.openide.util.HelpCtx; 25 import org.openide.util.NbBundle; 26 import org.netbeans.modules.tomcat5.nodes.TomcatInstanceNode; 27 import org.openide.util.actions.NodeAction; 28 29 30 35 public class OpenServerOutputAction extends NodeAction { 36 37 protected boolean enable(Node[] nodes) { 38 for (int i = 0; i < nodes.length; i++) { 39 TomcatInstanceNode cookie = (TomcatInstanceNode)nodes[i].getCookie(TomcatInstanceNode.class); 40 if (cookie == null || !cookie.hasServerLog()) { 41 return false; 42 } 43 } 44 return true; 45 } 46 47 public HelpCtx getHelpCtx() { 48 return HelpCtx.DEFAULT_HELP; 49 } 50 51 public String getName() { 52 return NbBundle.getMessage(SharedContextLogAction.class, "LBL_OpenServerOutput"); } 54 55 protected boolean asynchronous() { 56 return false; 57 } 58 59 protected void performAction(Node[] nodes) { 60 for (int i = 0; i < nodes.length; i++) { 61 TomcatInstanceNode cookie = (TomcatInstanceNode)nodes[i].getCookie(TomcatInstanceNode.class); 62 if (cookie != null) { 63 cookie.openServerLog(); 64 } 65 } 66 } 67 } 68 | Popular Tags |