1 19 20 package org.apache.jmeter.module; 21 22 import org.apache.jmeter.module.cookies.JMeterEditable; 23 import org.openide.cookies.EditCookie; 24 import org.openide.loaders.DataNode; 25 import org.openide.loaders.DataObject; 26 import org.openide.nodes.Node; 27 import org.openide.util.HelpCtx; 28 import org.openide.util.NbBundle; 29 import org.openide.util.actions.CookieAction; 30 31 public final class ExternalEditAction extends CookieAction { 32 33 protected void performAction(final Node[] activatedNodes) { 34 final JMeterEditable c = (JMeterEditable) activatedNodes[0].getCookie(JMeterEditable.class); 35 final DataObject dobj = (DataObject)activatedNodes[0].getCookie(DataObject.class); 36 37 c.edit(dobj.getPrimaryFile()); 38 } 39 40 protected int mode() { 41 return CookieAction.MODE_EXACTLY_ONE; 42 } 43 44 public String getName() { 45 return NbBundle.getMessage(ExternalEditAction.class, "CTL_ExternalEditAction"); 46 } 47 48 protected Class [] cookieClasses() { 49 return new Class [] { 50 DataObject.class, 51 JMeterEditable.class 52 }; 53 } 54 55 protected void initialize() { 56 super.initialize(); 57 putValue("noIconInMenu", Boolean.TRUE); 59 } 60 61 public HelpCtx getHelpCtx() { 62 return HelpCtx.DEFAULT_HELP; 63 } 64 65 protected boolean asynchronous() { 66 return false; 67 } 68 69 70 } 71 72 | Popular Tags |