/** 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; }
public void rollback() { if (overwrite) { run.overwriteText(overwrittenText, offset); overwrittenText = null; } else run.removeRange(offset, insertedChars.length); }
public void reapply() { if (overwrite) overwrittenText = run.overwriteText(new String(insertedChars), offset); else run.insertText(new String(insertedChars), offset); }
/** @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; }