/** * Creates a new uncommitted text command depending on whether * a compound change is currently being executed. * * @return a new, uncommitted text command or a compound text command */ protected TextCommand createCurrent() { return fFoldingIntoCompoundChange ? new CompoundTextCommand(fUndoContext) : new TextCommand(fUndoContext); }
@Override protected void updateCommand() { // first gather the data from the buffers super.updateCommand(); // the result of the command update is stored as a child command TextCommand c= new TextCommand(fUndoContext); c.fStart= fStart; c.fEnd= fEnd; c.fText= fText; c.fPreservedText= fPreservedText; c.fUndoModificationStamp= fUndoModificationStamp; c.fRedoModificationStamp= fRedoModificationStamp; add(c); // clear out all indexes now that the child is added reinitialize(); }
@Override protected void commit() { // if there is pending data, update the command if (fStart > -1) updateCommand(); fCurrent= createCurrent(); resetProcessChangeSate(); }
@Override protected void updateCommand() { // first gather the data from the buffers super.updateCommand(); // the result of the command update is stored as a child command TextCommand c= new TextCommand(fUndoContext); c.fStart= fStart; c.fEnd= fEnd; c.fText= fText; c.fPreservedText= fPreservedText; c.fUndoModificationStamp= fUndoModificationStamp; c.fRedoModificationStamp= fRedoModificationStamp; add(c); // clear out all indexes now that the child is added reinitialize(); }
@Override protected TextCommand createCurrent() { if (!fFoldingIntoCompoundChange) return new TextCommand(fUndoContext); reinitialize(); return this; }
@Override protected TextCommand createCurrent() { if (!fFoldingIntoCompoundChange) return new TextCommand(fUndoContext); reinitialize(); return this; }
/** * Creates a new uncommitted text command depending on whether * a compound change is currently being executed. * * @return a new, uncommitted text command or a compound text command */ protected TextCommand createCurrent() { return fFoldingIntoCompoundChange ? new CompoundTextCommand(fUndoContext) : new TextCommand(fUndoContext); }
@Override protected void commit() { // if there is pending data, update the command if (fStart > -1) updateCommand(); fCurrent= createCurrent(); resetProcessChangeSate(); }