public abstract static class CodeEvaluator.EvaluatorService extends Object
CodeEvaluator.EvaluatorService.Registration
annotation.Modifier and Type | Class and Description |
---|---|
static interface |
CodeEvaluator.EvaluatorService.Registration
Declarative registration of a EvaluatorService implementation.
|
Modifier and Type | Field and Description |
---|---|
static String |
PROP_CAN_EVALUATE
Property name fired in order to refresh the evaluate button state.
|
static String |
PROP_EXPRESSIONS_HISTORY
Property name fired in order to refresh the list of expressions history.
|
Constructor and Description |
---|
EvaluatorService() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener to be notified about property change events.
|
abstract boolean |
canEvaluate()
Provide status whether the service is ready to evaluate code now.
|
abstract void |
evaluate(String expression)
Evaluate the given expression.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fire a property change event.
|
abstract List<String> |
getExpressionsHistory()
Get the historical evaluated expressions.
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.
|
abstract void |
setupContext(JEditorPane editorPane,
Runnable setUpCallback)
Perform setup of the editor pane of the code evaluator.
|
public static final String PROP_CAN_EVALUATE
public static final String PROP_EXPRESSIONS_HISTORY
public abstract void setupContext(JEditorPane editorPane, Runnable setUpCallback)
editorPane
- setUpCallback
- call this back when the setup is finished.
As the setup may require asynchronous calls,
this is necessary to notify the infrastructure
that the code editor is set up.public abstract boolean canEvaluate()
PROP_CAN_EVALUATE
when this status changes.true
when code evaluation is possible (e.g. the debugger is suspended),
false
otherwise.public abstract void evaluate(String expression)
CodeEvaluator.Result
or any other custom result handler.expression
- The expression to evaluate.public abstract List<String> getExpressionsHistory()
protected final void firePropertyChange(String propertyName, Object oldValue, Object newValue)
propertyName
- The property name, one of PROP_* constants.oldValue
- An old valuenewValue
- A new valuepublic final void addPropertyChangeListener(PropertyChangeListener l)
l
- the property change listenerpublic final void removePropertyChangeListener(PropertyChangeListener l)
l
- the property change listener