|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.sp.jedit.BeanShellFacade<T>
public abstract class BeanShellFacade<T>
This class will be the interface for beanshell interaction.
In jEdit it will be used with the static methods of BeanShell
Field Summary | |
---|---|
protected BshClassManager |
classManager
|
protected NameSpace |
global
|
Constructor Summary | |
---|---|
protected |
BeanShellFacade()
|
Method Summary | |
---|---|
java.lang.Object |
_eval(T view,
NameSpace namespace,
java.lang.String command)
Evaluates the specified BeanShell expression. |
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(). |
protected static Interpreter |
createInterpreter(NameSpace nameSpace)
|
java.lang.Object |
eval(T param,
NameSpace namespace,
java.lang.String command)
Evaluates the specified BeanShell expression. |
java.lang.Object |
eval(T param,
java.lang.String command)
Evaluates the specified BeanShell expression with the global namespace |
void |
evalSelection(T param,
TextArea textArea)
Evaluates the text selected in the specified text area. |
NameSpace |
getNameSpace()
Returns the global namespace. |
protected abstract void |
handleException(T param,
java.lang.String path,
java.lang.Throwable t)
|
protected void |
init()
Initialize things. |
protected abstract void |
resetDefaultVariables(NameSpace namespace)
|
java.lang.Object |
runCachedBlock(BshMethod method,
T param,
NameSpace namespace)
Runs a cached block of code in the specified namespace. |
protected abstract void |
setupDefaultVariables(NameSpace namespace,
T param)
|
protected 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 |
---|
protected NameSpace global
protected BshClassManager classManager
Constructor Detail |
---|
protected BeanShellFacade()
Method Detail |
---|
protected void init()
public void evalSelection(T param, TextArea textArea)
public java.lang.Object eval(T param, java.lang.String command)
param
- The parametercommand
- The expressionpublic java.lang.Object eval(T param, NameSpace namespace, java.lang.String command)
param
- The parameternamespace
- The namespacecommand
- The expressionpublic java.lang.Object _eval(T view, NameSpace namespace, java.lang.String command) throws java.lang.Exception
eval()
, this method passes any exceptions to the caller.
view
- The view. Within the script, references to
buffer
, textArea
and editPane
are determined with reference to this parameter.namespace
- The namespacecommand
- The expression
java.lang.Exception
- instances are thrown when various BeanShell
errors occurpublic BshMethod cacheBlock(java.lang.String id, java.lang.String code, boolean namespace) throws java.lang.Exception
id
- An identifier.code
- The codenamespace
- If true, the namespace will be set
java.lang.Exception
- instances are thrown when various BeanShell errors
occurpublic java.lang.Object runCachedBlock(BshMethod method, T param, NameSpace namespace) throws java.lang.Exception
method
- The method instance returned by cacheBlock()namespace
- The namespace to run the code in
java.lang.Exception
- instances are thrown when various BeanShell
errors occurpublic NameSpace getNameSpace()
protected abstract void setupDefaultVariables(NameSpace namespace, T param) throws UtilEvalError
UtilEvalError
protected abstract void resetDefaultVariables(NameSpace namespace) throws UtilEvalError
UtilEvalError
protected abstract void handleException(T param, java.lang.String path, java.lang.Throwable t)
protected static Interpreter createInterpreter(NameSpace nameSpace)
protected static void unwrapException(java.lang.Exception e) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |