Constructor and Description |
---|
UndoableEditCommand(java.lang.String name,
Context context)
Creates an undoable edit wrapper command that manages initial selection.
|
UndoableEditCommand(java.lang.String name,
Context context,
boolean initialSelection)
Creates an undoable edit wrapper command.
|
UndoableEditCommand(java.lang.String name,
TextNode node,
Project project,
Workspace workspace)
Creates an undoable edit wrapper command without an IDE context that
manages the initial selection.
|
UndoableEditCommand(java.lang.String name,
TextNode node,
Project project,
Workspace workspace,
boolean initialSelection)
Creates an undoable edit wrapper command without an IDE context.
|
UndoableEditCommand(java.lang.String name,
TextNode node,
Project project,
Workspace workspace,
int selectionStart,
int selectionEnd)
Constructor callable from threads other than the event thread.
|
UndoableEditCommand(java.lang.String name,
TextNode node,
Project project,
Workspace workspace,
int selectionStart,
int selectionEnd,
java.util.List<Selection> multiSelections)
Constructor callable from threads other than the event thread.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdit(javax.swing.undo.UndoableEdit edit) |
void |
addEdits(java.util.Collection<javax.swing.undo.UndoableEdit> edits) |
int |
doit()
Executes the actions associated with a specific command.
|
boolean |
hasEdits() |
void |
setMultiSelections(java.util.List<Selection> multiSelections)
set the multi selections
|
void |
setSelection(int offset,
int length) |
void |
setSelection(java.net.URL url,
int offset,
int length) |
int |
undo()
Called by the CommandProcessor to undo a command.
|
enableConfirmation, getAffectedNodes, getContext, getData, getId, getName, getProgressHandle, getType, isGlobal, setContext, setData, setTaskInfo
public UndoableEditCommand(java.lang.String name, Context context)
name
- The presentation name of this command.context
- The ide context for this command.public UndoableEditCommand(java.lang.String name, TextNode node, Project project, Workspace workspace)
name
- The presentation name of this command.node
- The node to which this command applies.project
- The project context for this command.workspace
- The workspace context for this command.public UndoableEditCommand(java.lang.String name, Context context, boolean initialSelection)
initialSelection
will typically only be false for commands
after the first in a sequence of commands.
name
- The presentation name of this command.context
- The ide context for this command.initialSelection
- Whether command should manage initial selection.public UndoableEditCommand(java.lang.String name, TextNode node, Project project, Workspace workspace, int selectionStart, int selectionEnd)
name
- node
- project
- workspace
- selectionStart
- selectionEnd
- public UndoableEditCommand(java.lang.String name, TextNode node, Project project, Workspace workspace, int selectionStart, int selectionEnd, java.util.List<Selection> multiSelections)
name
- node
- project
- workspace
- selectionStart
- selectionEnd
- multiSelection
- additional selectionspublic UndoableEditCommand(java.lang.String name, TextNode node, Project project, Workspace workspace, boolean initialSelection)
name
- The presentation name of this command.node
- The node to which this command applies.project
- The project context for this command.workspace
- The workspace context for this command.initialSelection
- Whether command should manage initial selection.public void addEdit(javax.swing.undo.UndoableEdit edit)
public void addEdits(java.util.Collection<javax.swing.undo.UndoableEdit> edits)
public boolean hasEdits()
public void setSelection(java.net.URL url, int offset, int length)
public void setSelection(int offset, int length)
public void setMultiSelections(java.util.List<Selection> multiSelections)
selections
- public int doit() throws java.lang.Exception
Command
public int undo() throws java.lang.Exception
Command
doit
method was called
When a command executes successfully, implementations should
return OK, otherwise, return CANCEL or any other non-zero value.