|
|||||||||
| Home >> All >> org >> gjt >> sp >> [ jedit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.gjt.sp.jedit
Class BeanShell

java.lang.Objectorg.gjt.sp.jedit.BeanShell
- public class BeanShell
- extends java.lang.Object
BeanShell is jEdit's extension language.
When run from jEdit, BeanShell code has access to the following predefined variables:
view- the currently active View.editPane- the currently active EditPane.textArea- the edit pane's org.gjt.sp.jedit.textarea.JEditTextArea.buffer- the edit pane's Buffer.wm- the view's org.gjt.sp.jedit.gui.DockableWindowManager.scriptPath- the path name of the currently executing BeanShell script.
- Version:
- $Id: BeanShell.java,v 1.43 2003/09/09 23:40:43 spestov Exp $
| Nested Class Summary | |
(package private) static class |
BeanShell.CustomClassManager
|
| Field Summary | |
private static BeanShell.CustomClassManager |
classManager
|
private static bsh.NameSpace |
global
|
private static bsh.Interpreter |
interpForMethods
|
private static java.lang.Object[] |
NO_ARGS
|
private static boolean |
running
|
| Constructor Summary | |
BeanShell()
|
|
| Method Summary | |
static java.lang.Object |
_eval(View view,
bsh.NameSpace namespace,
java.lang.String command)
Evaluates the specified BeanShell expression. |
static void |
_runScript(View view,
java.lang.String path,
java.io.Reader in,
boolean ownNamespace)
Runs a BeanShell script. |
static void |
_runScript(View view,
java.lang.String path,
java.io.Reader in,
bsh.NameSpace namespace)
Runs a BeanShell script. |
static bsh.BshMethod |
cacheBlock(java.lang.String id,
java.lang.String code,
boolean namespace)
Caches a block of code, returning a handle that can be passed to runCachedBlock(). |
private static bsh.Interpreter |
createInterpreter(bsh.NameSpace nameSpace)
|
static java.lang.Object |
eval(View view,
bsh.NameSpace namespace,
java.lang.String command)
Evaluates the specified BeanShell expression. |
static java.lang.Object |
eval(View view,
bsh.NameSpace namespace,
java.lang.String command,
boolean rethrowBshErrors)
Deprecated. The rethrowBshErrors parameter is now
obsolete; call _eval() or eval() instead. |
static java.lang.Object |
eval(View view,
java.lang.String command,
boolean rethrowBshErrors)
Deprecated. The rethrowBshErrors parameter is now
obsolete; call _eval() or eval() instead. |
static void |
evalSelection(View view,
org.gjt.sp.jedit.textarea.JEditTextArea textArea)
Evaluates the text selected in the specified text area. |
static bsh.NameSpace |
getNameSpace()
Returns the global namespace. |
private static void |
handleException(View view,
java.lang.String path,
java.lang.Throwable t)
|
(package private) static void |
init()
|
static boolean |
isScriptRunning()
Returns if a BeanShell script or macro is currently running. |
(package private) static void |
resetClassManager()
Causes BeanShell internal structures to drop references to cached Class instances. |
private static void |
resetDefaultVariables(bsh.NameSpace namespace)
|
static java.lang.Object |
runCachedBlock(bsh.BshMethod method,
View view,
bsh.NameSpace namespace)
Runs a cached block of code in the specified namespace. |
static void |
runScript(View view,
java.lang.String path,
boolean ownNamespace,
boolean rethrowBshErrors)
Deprecated. The rethrowBshErrors parameter is now
obsolete; call _runScript() or runScript()
instead. |
static void |
runScript(View view,
java.lang.String path,
java.io.Reader in,
boolean ownNamespace)
Runs a BeanShell script. |
static void |
runScript(View view,
java.lang.String path,
java.io.Reader in,
boolean ownNamespace,
boolean rethrowBshErrors)
Deprecated. The rethrowBshErrors parameter is now
obsolete; call _runScript() or runScript()
instead. |
static void |
runScript(View view,
java.lang.String path,
java.io.Reader in,
bsh.NameSpace namespace)
Runs a BeanShell script. |
private static void |
setupDefaultVariables(bsh.NameSpace namespace,
View view)
|
static void |
showEvaluateDialog(View view)
Prompts for a BeanShell expression to evaluate. |
static void |
showEvaluateLinesDialog(View view)
Evaluates the specified script for each selected line. |
private static void |
unwrapException(java.lang.Exception e)
This extracts an exception from a 'wrapping' exception, as BeanShell sometimes throws. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
NO_ARGS
private static final java.lang.Object[] NO_ARGS
classManager
private static BeanShell.CustomClassManager classManager
interpForMethods
private static bsh.Interpreter interpForMethods
global
private static bsh.NameSpace global
running
private static boolean running
| Constructor Detail |
BeanShell
public BeanShell()
| Method Detail |
evalSelection
public static void evalSelection(View view, org.gjt.sp.jedit.textarea.JEditTextArea textArea)
- Evaluates the text selected in the specified text area.
- Since:
- jEdit 2.7pre2
showEvaluateDialog
public static void showEvaluateDialog(View view)
- Prompts for a BeanShell expression to evaluate.
- Since:
- jEdit 2.7pre2
showEvaluateLinesDialog
public static void showEvaluateLinesDialog(View view)
- Evaluates the specified script for each selected line.
- Since:
- jEdit 4.0pre1
runScript
public static void runScript(View view, java.lang.String path, java.io.Reader in, boolean ownNamespace)
- Runs a BeanShell script. Errors are shown in a dialog box.
If the
inparameter is non-null, the script is read from that stream; otherwise it is read from the file identified bypath.The
scriptPathBeanShell variable is set to the path name of the script.- Since:
- jEdit 4.0pre7
runScript
public static void runScript(View view, java.lang.String path, java.io.Reader in, bsh.NameSpace namespace)
- Runs a BeanShell script. Errors are shown in a dialog box.
If the
inparameter is non-null, the script is read from that stream; otherwise it is read from the file identified bypath.The
scriptPathBeanShell variable is set to the path name of the script.- Since:
- jEdit 4.2pre5
_runScript
public static void _runScript(View view, java.lang.String path, java.io.Reader in, boolean ownNamespace) throws java.lang.Exception
- Runs a BeanShell script. Errors are passed to the caller.
If the
inparameter is non-null, the script is read from that stream; otherwise it is read from the file identified bypath.The
scriptPathBeanShell variable is set to the path name of the script.- Since:
- jEdit 4.0pre7
_runScript
public static void _runScript(View view, java.lang.String path, java.io.Reader in, bsh.NameSpace namespace) throws java.lang.Exception
- Runs a BeanShell script. Errors are passed to the caller.
If the
inparameter is non-null, the script is read from that stream; otherwise it is read from the file identified bypath.The
scriptPathBeanShell variable is set to the path name of the script.- Since:
- jEdit 4.2pre5
eval
public static java.lang.Object eval(View view, bsh.NameSpace namespace, java.lang.String command)
- Evaluates the specified BeanShell expression. Errors are reported in
a dialog box.
- Since:
- jEdit 4.0pre8
_eval
public static java.lang.Object _eval(View view, bsh.NameSpace namespace, java.lang.String command) throws java.lang.Exception
- Evaluates the specified BeanShell expression. Unlike
eval(), this method passes any exceptions to the caller.- Since:
- jEdit 3.2pre7
cacheBlock
public static bsh.BshMethod cacheBlock(java.lang.String id, java.lang.String code, boolean namespace) throws java.lang.Exception
- Caches a block of code, returning a handle that can be passed to
runCachedBlock().
- Since:
- jEdit 4.1pre1
runCachedBlock
public static java.lang.Object runCachedBlock(bsh.BshMethod method, View view, bsh.NameSpace namespace) throws java.lang.Exception
- Runs a cached block of code in the specified namespace. Faster than
evaluating the block each time.
- Since:
- jEdit 4.1pre1
isScriptRunning
public static boolean isScriptRunning()
- Returns if a BeanShell script or macro is currently running.
- Since:
- jEdit 2.7pre2
getNameSpace
public static bsh.NameSpace getNameSpace()
- Returns the global namespace.
- Since:
- jEdit 3.2pre5
runScript
public static void runScript(View view, java.lang.String path, boolean ownNamespace, boolean rethrowBshErrors)
- Deprecated. The
rethrowBshErrorsparameter is now obsolete; call_runScript()orrunScript()instead.
runScript
public static void runScript(View view, java.lang.String path, java.io.Reader in, boolean ownNamespace, boolean rethrowBshErrors)
- Deprecated. The
rethrowBshErrorsparameter is now obsolete; call_runScript()orrunScript()instead.
eval
public static java.lang.Object eval(View view, java.lang.String command, boolean rethrowBshErrors)
- Deprecated. The
rethrowBshErrorsparameter is now obsolete; call_eval()oreval()instead.
eval
public static java.lang.Object eval(View view, bsh.NameSpace namespace, java.lang.String command, boolean rethrowBshErrors)
- Deprecated. The
rethrowBshErrorsparameter is now obsolete; call_eval()oreval()instead.
init
static void init()
resetClassManager
static void resetClassManager()
- Causes BeanShell internal structures to drop references to cached
Class instances.
setupDefaultVariables
private static void setupDefaultVariables(bsh.NameSpace namespace, View view) throws bsh.UtilEvalError
resetDefaultVariables
private static void resetDefaultVariables(bsh.NameSpace namespace) throws bsh.UtilEvalError
unwrapException
private static void unwrapException(java.lang.Exception e) throws java.lang.Exception
- This extracts an exception from a 'wrapping' exception, as BeanShell
sometimes throws. This gives the user a more accurate error traceback
handleException
private static void handleException(View view, java.lang.String path, java.lang.Throwable t)
createInterpreter
private static bsh.Interpreter createInterpreter(bsh.NameSpace nameSpace)
|
|||||||||
| Home >> All >> org >> gjt >> sp >> [ jedit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.gjt.sp.jedit.BeanShell