| java.lang.Object org.gjt.sp.jedit.BeanShell
BeanShell | public class BeanShell (Code) | | BeanShell is jEdit's extension language.
When run from jEdit, BeanShell code has access to the following predefined
variables:
author: Slava Pestov version: $Id: BeanShell.java 10803 2007-10-04 20:45:31Z kpouer $ |
Method Summary | |
public static Object | _eval(View view, NameSpace namespace, String command) Evaluates the specified BeanShell expression. | public static void | _runScript(View view, String path, Reader in, boolean ownNamespace) Runs a BeanShell script. | public static void | _runScript(View view, String path, Reader in, NameSpace namespace) Runs a BeanShell script. | public static BshMethod | cacheBlock(String id, String code, boolean namespace) Caches a block of code, returning a handle that can be passed to
runCachedBlock().
Parameters: id - An identifier. | public static Object | eval(View view, NameSpace namespace, String command) Evaluates the specified BeanShell expression. | public static Object | eval(View view, String command, boolean rethrowBshErrors) | public static Object | eval(View view, NameSpace namespace, String command, boolean rethrowBshErrors) | public static void | evalSelection(View view, JEditTextArea textArea) Evaluates the text selected in the specified text area. | public static NameSpace | getNameSpace() Returns the global namespace. | static void | init() | public static boolean | isScriptRunning() Returns if a BeanShell script or macro is currently running. | static void | resetClassManager() Causes BeanShell internal structures to drop references to cached
Class instances. | public static Object | runCachedBlock(BshMethod method, View view, NameSpace namespace) Runs a cached block of code in the specified namespace. | public static void | runScript(View view, String path, Reader in, boolean ownNamespace) Runs a BeanShell script. | public static void | runScript(View view, String path, Reader in, NameSpace namespace) Runs a BeanShell script. | public static void | runScript(View view, String path, boolean ownNamespace, boolean rethrowBshErrors) | public static void | runScript(View view, String path, Reader in, boolean ownNamespace, boolean rethrowBshErrors) | public static void | showEvaluateDialog(View view) Prompts for a BeanShell expression to evaluate. | public static void | showEvaluateLinesDialog(View view) Evaluates the specified script for each selected line. |
_eval | public static Object _eval(View view, NameSpace namespace, String command) throws Exception(Code) | | Evaluates the specified BeanShell expression. Unlike
eval() , this method passes any exceptions to the caller.
Parameters: view - The view. Within the script, references tobuffer , textArea and editPane are determined with reference to this parameter. Parameters: namespace - The namespace Parameters: command - The expression exception: Exception - instances are thrown when various BeanShellerrors occur since: jEdit 3.2pre7 |
_runScript | public static void _runScript(View view, String path, Reader in, boolean ownNamespace) throws Exception(Code) | | Runs a BeanShell script. Errors are passed to the caller.
If the in parameter is non-null, the script is
read from that stream; otherwise it is read from the file identified
by path .
The scriptPath BeanShell variable is set to the path
name of the script.
Parameters: view - The view. Within the script, references tobuffer , textArea and editPane are determined with reference to this parameter. Parameters: path - The script file's VFS path. Parameters: in - The reader to read the script from, or null . Parameters: ownNamespace - If set to false , methods andvariables defined in the script will be available to all futureuses of BeanShell; if set to true , they will be lost assoon as the script finishes executing. jEdit uses a value offalse when running startup scripts, and a value oftrue when running all other macros. exception: Exception - instances are thrown when various BeanShell errorsoccur since: jEdit 4.0pre7 |
_runScript | public static void _runScript(View view, String path, Reader in, NameSpace namespace) throws Exception(Code) | | Runs a BeanShell script. Errors are passed to the caller.
If the in parameter is non-null, the script is
read from that stream; otherwise it is read from the file identified
by path .
The scriptPath BeanShell variable is set to the path
name of the script.
Parameters: view - The view. Within the script, references tobuffer , textArea and editPane are determined with reference to this parameter. Parameters: path - The script file's VFS path. Parameters: in - The reader to read the script from, or null . Parameters: namespace - The namespace to run the script in. exception: Exception - instances are thrown when various BeanShell errorsoccur since: jEdit 4.2pre5 |
cacheBlock | public static BshMethod cacheBlock(String id, String code, boolean namespace) throws Exception(Code) | | Caches a block of code, returning a handle that can be passed to
runCachedBlock().
Parameters: id - An identifier. If null, a unique identifier is generated Parameters: code - The code Parameters: namespace - If true, the namespace will be set exception: Exception - instances are thrown when various BeanShell errorsoccur since: jEdit 4.1pre1 |
eval | public static Object eval(View view, NameSpace namespace, String command)(Code) | | Evaluates the specified BeanShell expression. Errors are reported in
a dialog box.
Parameters: view - The view. Within the script, references tobuffer , textArea and editPane are determined with reference to this parameter. Parameters: namespace - The namespace Parameters: command - The expression since: jEdit 4.0pre8 |
evalSelection | public static void evalSelection(View view, JEditTextArea textArea)(Code) | | Evaluates the text selected in the specified text area.
since: jEdit 2.7pre2 |
getNameSpace | public static NameSpace getNameSpace()(Code) | | Returns the global namespace.
since: jEdit 3.2pre5 |
isScriptRunning | public static boolean isScriptRunning()(Code) | | Returns if a BeanShell script or macro is currently running.
since: jEdit 2.7pre2 |
resetClassManager | static void resetClassManager()(Code) | | Causes BeanShell internal structures to drop references to cached
Class instances.
|
runCachedBlock | public static Object runCachedBlock(BshMethod method, View view, NameSpace namespace) throws Exception(Code) | | Runs a cached block of code in the specified namespace. Faster than
evaluating the block each time.
Parameters: method - The method instance returned by cacheBlock() Parameters: view - The view Parameters: namespace - The namespace to run the code in exception: Exception - instances are thrown when various BeanShellerrors occur since: jEdit 4.1pre1 |
runScript | public static void runScript(View view, String path, Reader in, boolean ownNamespace)(Code) | | Runs a BeanShell script. Errors are shown in a dialog box.
If the in parameter is non-null, the script is
read from that stream; otherwise it is read from the file identified
by path .
The scriptPath BeanShell variable is set to the path
name of the script.
Parameters: view - The view. Within the script, references tobuffer , textArea and editPane are determined with reference to this parameter. Parameters: path - The script file's VFS path. Parameters: in - The reader to read the script from, or null . Parameters: ownNamespace - If set to false , methods andvariables defined in the script will be available to all futureuses of BeanShell; if set to true , they will be lost assoon as the script finishes executing. jEdit uses a value offalse when running startup scripts, and a value oftrue when running all other macros. since: jEdit 4.0pre7 |
runScript | public static void runScript(View view, String path, Reader in, NameSpace namespace)(Code) | | Runs a BeanShell script. Errors are shown in a dialog box.
If the in parameter is non-null, the script is
read from that stream; otherwise it is read from the file identified
by path .
The scriptPath BeanShell variable is set to the path
name of the script.
Parameters: view - The view. Within the script, references tobuffer , textArea and editPane are determined with reference to this parameter. Parameters: path - The script file's VFS path. Parameters: in - The reader to read the script from, or null . Parameters: namespace - The namespace to run the script in. since: jEdit 4.2pre5 |
runScript | public static void runScript(View view, String path, boolean ownNamespace, boolean rethrowBshErrors)(Code) | | |
runScript | public static void runScript(View view, String path, Reader in, boolean ownNamespace, boolean rethrowBshErrors)(Code) | | |
showEvaluateDialog | public static void showEvaluateDialog(View view)(Code) | | Prompts for a BeanShell expression to evaluate.
since: jEdit 2.7pre2 |
showEvaluateLinesDialog | public static void showEvaluateLinesDialog(View view)(Code) | | Evaluates the specified script for each selected line.
since: jEdit 4.0pre1 |
|
|