package Templates.API_Support.Actions_API; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; /** * Action that can always be invoked and work procedurally. * @author __USER__ */ public class __Sample_callable__Action extends CallableSystemAction { public __Sample_callable__Action() { } public void performAction() { // do what you want, e.g.: //org.openide.awt.StatusDisplayer.getDefault().setStatusText("Hello World! " + new java.util.Date()); // usually myTopComponent.activate(); } public String getName() { return NbBundle.getMessage(__NAME__.class, "LBL_Action"); } protected String iconResource() { return "__PACKAGE_AND_NAME_SLASHES__Icon.gif"; } public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; // If you will provide context help then use: // return new HelpCtx(__NAME__.class); } protected boolean asynchronous() { // performAction() should run in event thread return false; } /** Perform extra initialization of this action's singleton. * PLEASE do not use constructors for this purpose! protected void initialize() { super.initialize(); putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(__NAME__.class, "HINT_Action")); } */ }