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