@Override public void reset() { if (isConnected()) { initializeCommandStack(); fCurrent= new TextCommand(fUndoContext); fFoldingIntoCompoundChange= false; fInserting= false; fOverwriting= false; fTextBuffer.setLength(0); fPreservedTextBuffer.setLength(0); fPreservedUndoModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; fPreservedRedoModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; } }
@Override public void reset() { if (isConnected()) { initializeCommandStack(); fCurrent= new TextCommand(fUndoContext); fFoldingIntoCompoundChange= false; fInserting= false; fOverwriting= false; fTextBuffer.setLength(0); fPreservedTextBuffer.setLength(0); fPreservedUndoModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; fPreservedRedoModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; } }
@Override public void connect(ITextViewer textViewer) { if (!isConnected() && textViewer != null) { fTextViewer= textViewer; fTextBuffer= new StringBuilder(); fPreservedTextBuffer= new StringBuilder(); if (fUndoContext == null) fUndoContext= new ObjectUndoContext(this); fHistory.setLimit(fUndoContext, fUndoLevel); initializeCommandStack(); // open up the current command fCurrent= new TextCommand(fUndoContext); fPreviousDelete= new TextCommand(fUndoContext); addListeners(); } }
@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 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 public void connect(ITextViewer textViewer) { if (!isConnected() && textViewer != null) { fTextViewer= textViewer; fTextBuffer= new StringBuffer(); fPreservedTextBuffer= new StringBuffer(); if (fUndoContext == null) fUndoContext= new ObjectUndoContext(this); fHistory.setLimit(fUndoContext, fUndoLevel); initializeCommandStack(); // open up the current command fCurrent= new TextCommand(fUndoContext); fPreviousDelete= new TextCommand(fUndoContext); addListeners(); } }
@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 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); }