Exemple #1
0
 /** re-executes the command for the additional character added above. */
 public void commitPending() {
   if (overwrite) overwrittenText += run.overwriteText(pending, offset + insertedChars.length);
   else run.insertText(pending, offset + insertedChars.length);
   char old[] = insertedChars;
   insertedChars = new char[old.length + 1];
   System.arraycopy(old, 0, insertedChars, 0, old.length);
   insertedChars[insertedChars.length - 1] = pending.toCharArray()[0];
   pending = null;
 }
Exemple #2
0
 public void rollback() {
   if (overwrite) {
     run.overwriteText(overwrittenText, offset);
     overwrittenText = null;
   } else run.removeRange(offset, insertedChars.length);
 }
Exemple #3
0
 public void reapply() {
   if (overwrite) overwrittenText = run.overwriteText(new String(insertedChars), offset);
   else run.insertText(new String(insertedChars), offset);
 }
Exemple #4
0
 /** @see org.eclipse.gef.commands.Command#execute() */
 public void apply() {
   if (overwrite) overwrittenText = run.overwriteText(pending, offset);
   else run.insertText(pending, offset);
   insertedChars = pending.toCharArray();
   pending = null;
 }