/** * Try to determine whether this event can replace the old one. This is used * to batch the one-letter modifications into larger parts (words) and * undoing/redoing them at once. This method returns true whether */ public boolean replaceEdit(UndoableEdit anEdit) { BaseDocument doc = (BaseDocument) getDocument(); if (anEdit instanceof BaseDocumentEvent) { BaseDocumentEvent evt = (BaseDocumentEvent) anEdit; if (!doc.undoMergeReset && canMerge(evt)) { previous = evt; return true; } } doc.undoMergeReset = false; return false; }
/** Try to determine whether this event can replace the old one. * This is used to batch the one-letter modifications into larger * parts (words) and undoing/redoing them at once. * This method returns true whether */ public boolean replaceEdit(UndoableEdit anEdit) { BaseDocument doc = (BaseDocument)getDocument(); if (anEdit instanceof BaseDocumentEvent) { BaseDocumentEvent evt = (BaseDocumentEvent)anEdit; if (!doc.undoMergeReset && canMerge(evt)) { previous = evt; return true; } } doc.undoMergeReset = false; return false; }