| java.lang.Object org.gjt.sp.jedit.Macros
All known Subclasses: jars.MacOS.macos.script.AppleScriptHandler,
Macros | public class Macros (Code) | | This class records and runs macros.
It also contains a few methods useful for displaying output messages
or obtaining input from a macro:
-
Macros.confirm(Component,String,int)
-
Macros.confirm(Component,String,int,int)
-
Macros.error(Component,String)
-
Macros.input(Component,String)
-
Macros.input(Component,String,String)
-
Macros.message(Component,String)
Note that plugins should not use the above methods. Call
the methods in the
GUIUtilities class instead.
author: Slava Pestov version: $Id: Macros.java 10714 2007-09-22 20:50:20Z kpouer $ |
Inner Class :public static class Macro extends EditAction | |
Inner Class :public static class Recorder implements EBComponent | |
Inner Class :abstract public static class Handler | |
Inner Class :static class BeanShellHandler extends Handler | |
Method Summary | |
public static int | confirm(Component comp, String prompt, int buttons) Utility method that can be used to ask for confirmation in a macro. | public static int | confirm(Component comp, String prompt, int buttons, int type) Utility method that can be used to ask for confirmation in a macro. | public static void | error(Component comp, String message) Utility method that can be used to display an error dialog in a macro. | public static Handler | getHandler(String name) Returns the macro handler with the specified name, or null if
there is no registered handler with that name. | public static Handler | getHandlerForPathName(String pathName) Returns the macro handler suitable for running the specified file
name, or null if there is no suitable handler. | public static Handler[] | getHandlers() | public static Macro | getLastMacro() | public static Macro | getMacro(String macro) Returns the macro with the specified name. | public static ActionSet | getMacroActionSet() Returns an action set with all known macros in it. | public static Vector | getMacroHierarchy() Returns a vector hierarchy with all known macros in it.
Each element of this vector is either a macro name string,
or another vector. | public static String | input(Component comp, String prompt) Utility method that can be used to prompt for input in a macro. | public static String | input(Component comp, String prompt, String defaultValue) Utility method that can be used to prompt for input in a macro. | public static void | loadMacros() | public static void | message(Component comp, String message) Utility method that can be used to display a message dialog in a macro. | public static void | recordMacro(View view) Starts recording a macro. | public static void | recordTemporaryMacro(View view) Starts recording a temporary macro. | public static void | registerHandler(Handler handler) | public static void | runScript(View view, String path, boolean ignoreUnknown) Runs the specified script. | public static void | runTemporaryMacro(View view) Runs the temporary macro. | public static void | setLastMacro(Macro macro) | public static void | showRunScriptDialog(View view) | public static void | stopRecording(View view) Stops a recording currently in progress. |
confirm | public static int confirm(Component comp, String prompt, int buttons)(Code) | | Utility method that can be used to ask for confirmation in a macro.
Parameters: comp - The component to show the dialog on behalf of, thiswill usually be a view instance Parameters: prompt - The prompt string Parameters: buttons - The buttons to display - for example,JOptionPane.YES_NO_CANCEL_OPTION since: jEdit 4.0pre2 |
confirm | public static int confirm(Component comp, String prompt, int buttons, int type)(Code) | | Utility method that can be used to ask for confirmation in a macro.
Parameters: comp - The component to show the dialog on behalf of, thiswill usually be a view instance Parameters: prompt - The prompt string Parameters: buttons - The buttons to display - for example,JOptionPane.YES_NO_CANCEL_OPTION Parameters: type - The dialog type - for example,JOptionPane.WARNING_MESSAGE |
error | public static void error(Component comp, String message)(Code) | | Utility method that can be used to display an error dialog in a macro.
Parameters: comp - The component to show the dialog on behalf of, thiswill usually be a view instance Parameters: message - The message since: jEdit 2.7pre2 |
getHandler | public static Handler getHandler(String name)(Code) | | Returns the macro handler with the specified name, or null if
there is no registered handler with that name.
since: jEdit 4.0pre6 |
getHandlerForPathName | public static Handler getHandlerForPathName(String pathName)(Code) | | Returns the macro handler suitable for running the specified file
name, or null if there is no suitable handler.
since: jEdit 4.1pre3 |
getHandlers | public static Handler[] getHandlers()(Code) | | Returns an array containing the list of registered macro handlers
since: jEdit 4.0pre6 |
getLastMacro | public static Macro getLastMacro()(Code) | | since: jEdit 4.3pre1 |
getMacro | public static Macro getMacro(String macro)(Code) | | Returns the macro with the specified name.
Parameters: macro - The macro's name since: jEdit 2.6pre1 |
getMacroActionSet | public static ActionSet getMacroActionSet()(Code) | | Returns an action set with all known macros in it.
since: jEdit 4.0pre1 |
getMacroHierarchy | public static Vector getMacroHierarchy()(Code) | | Returns a vector hierarchy with all known macros in it.
Each element of this vector is either a macro name string,
or another vector. If it is a vector, the first element is a
string label, the rest are again, either macro name strings
or vectors.
since: jEdit 2.6pre1 |
input | public static String input(Component comp, String prompt)(Code) | | Utility method that can be used to prompt for input in a macro.
Parameters: comp - The component to show the dialog on behalf of, thiswill usually be a view instance Parameters: prompt - The prompt string since: jEdit 2.7pre2 |
input | public static String input(Component comp, String prompt, String defaultValue)(Code) | | Utility method that can be used to prompt for input in a macro.
Parameters: comp - The component to show the dialog on behalf of, thiswill usually be a view instance Parameters: prompt - The prompt string since: jEdit 3.1final |
loadMacros | public static void loadMacros()(Code) | | Rebuilds the macros list, and sends a MacrosChanged message
(views update their Macros menu upon receiving it)
since: jEdit 2.2pre4 |
message | public static void message(Component comp, String message)(Code) | | Utility method that can be used to display a message dialog in a macro.
Parameters: comp - The component to show the dialog on behalf of, thiswill usually be a view instance Parameters: message - The message since: jEdit 2.7pre2 |
recordMacro | public static void recordMacro(View view)(Code) | | Starts recording a macro.
Parameters: view - The view since: jEdit 2.7pre2 |
recordTemporaryMacro | public static void recordTemporaryMacro(View view)(Code) | | Starts recording a temporary macro.
Parameters: view - The view since: jEdit 2.7pre2 |
registerHandler | public static void registerHandler(Handler handler)(Code) | | Adds a macro handler to the handlers list
since: jEdit 4.0pre6 |
runScript | public static void runScript(View view, String path, boolean ignoreUnknown)(Code) | | Runs the specified script.
Unlike the
BeanShell.runScript(ViewStringReaderboolean) method, this method can run scripts supported
by any registered macro handler.
Parameters: view - The view Parameters: path - The VFS path of the script Parameters: ignoreUnknown - If true, then unknown file types will beignored; otherwise, a warning message will be printed and they willbe evaluated as BeanShell scripts. since: jEdit 4.1pre2 |
runTemporaryMacro | public static void runTemporaryMacro(View view)(Code) | | Runs the temporary macro.
Parameters: view - The view since: jEdit 2.7pre2 |
setLastMacro | public static void setLastMacro(Macro macro)(Code) | | since: jEdit 4.3pre1 |
showRunScriptDialog | public static void showRunScriptDialog(View view)(Code) | | Prompts for one or more files to run as macros
Parameters: view - The view since: jEdit 4.0pre7 |
stopRecording | public static void stopRecording(View view)(Code) | | Stops a recording currently in progress.
Parameters: view - The view since: jEdit 2.7pre2 |
|
|