public abstract class TextNodeActionDelegate extends NodeActionDelegate
Constructor and Description |
---|
TextNodeActionDelegate() |
Modifier and Type | Method and Description |
---|---|
int[] |
doAction(Context context,
Element[] elements,
int[] text,
IdeAction action)
Does the action on a
Node . |
protected abstract int[] |
doAction(TextBuffer buffer,
Context context,
Element[] elements,
int[] text,
IdeAction action)
Does the action on a
TextBuffer . |
void |
undoAction(Context context,
Element[] elements,
int[] text,
IdeAction action)
Undoes the action on a node.
|
isEnabled
protected abstract int[] doAction(TextBuffer buffer, Context context, Element[] elements, int[] text, IdeAction action)
TextBuffer
. This method is invoked on
a background thread and should not, in general, invoke any Swing or
UI methods.buffer
- The text buffer, write locked and in a compound edit.context
- An IDE context specifying the node, project, and workspace.elements
- An array of Element
s specifying the selected
elements within the node, or null if none.text
- A two element int array specifying the start and end offsets
of the selected text within the node, or null if none.action
- The IDE action to do.public int[] doAction(Context context, Element[] elements, int[] text, IdeAction action)
Node
. This method is invoked on
a background thread and should not, in general, invoke any Swing or
UI methods.
The TextNodeActionDelegate
implementation.doAction
in class NodeActionDelegate
context
- An IDE context specifying the node, project, and workspace.elements
- An array of Element
s specifying the selected
elements within the node, or null if none.text
- A two element int array specifying the start and end offsets
of the selected text within the node, or null if none.action
- The IDE action to do.public void undoAction(Context context, Element[] elements, int[] text, IdeAction action)
NodeActionDelegate
undoAction
in class NodeActionDelegate
context
- An IDE context specifying the node, project, and workspace.elements
- An array of Element
s specifying the selected
elements within the node, or null if none.text
- A two element int array specifying the start and end offsetaction
- The IDE action to undo.