public class TextBufferCommand extends Command
| Constructor and Description | 
|---|
TextBufferCommand(java.lang.String name,
                 TextBuffer buffer)
Creates a text transform command. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
doit()
Executes the actions associated with a specific command. 
 | 
void | 
insert(int offset,
      char[] text)
Inserts text into the buffer. 
 | 
void | 
insert(int offset,
      java.lang.String text)
Inserts text into the buffer. 
 | 
void | 
remove(int offset,
      int length)
Removes text from the buffer. 
 | 
int | 
undo()
Called by the CommandProcessor to undo a command. 
 | 
enableConfirmation, getAffectedNodes, getContext, getData, getId, getName, getProgressHandle, getType, isGlobal, setContext, setData, setTaskInfopublic TextBufferCommand(java.lang.String name,
                 TextBuffer buffer)
name - The name of the command.buffer - The buffer to be transformed by this command.public void insert(int offset,
          char[] text)
offset - The character offset before which to insert.text - The text to insert.public void insert(int offset,
          java.lang.String text)
offset - The character offset before which to insert.text - The text to insert.public void remove(int offset,
          int length)
offset - The character offset before the first character to remove.length - The number of characters to remove.public int doit()
         throws java.lang.Exception
Commandpublic int undo()
         throws java.lang.Exception
Commanddoit method was called
  When a command executes successfully, implementations should
  return OK, otherwise, return CANCEL or any other non-zero value.