Package icyllis.modernui.widget
Class Editor.EditOperation
- All Implemented Interfaces:
Parcelable
- Enclosing class:
Editor
An operation to undo a single "edit" to a text view.
-
Nested Class Summary
Nested classes/interfaces inherited from interface icyllis.modernui.util.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>, Parcelable.WriteFlags
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Parcelable.ClassLoaderCreator
<Editor.EditOperation> -
Constructor Summary
ConstructorDescriptionEditOperation
(Parcel src, ClassLoader loader) EditOperation
(Editor editor, String oldText, int dstart, String newText) Constructs an edit operation from a text input operation on editor that replaces the oldText starting at dstart with newText. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
Called when this undo state is being committed to the undo stack.void
Forcibly creates a single merged edit operation by simulating the entire text contents being replaced.void
redo()
Called when this undo state is being pushed back from the transient redo stack to the main undo stack.toString()
void
undo()
Called when this undo state is being popped off the undo stack (in to the temporary redo stack).void
writeToParcel
(Parcel dest, int flags) The subclass implements the method to flatten its contents by calling the methods ofParcel
for its primitive values.Methods inherited from class icyllis.modernui.core.UndoOperation
allowMerge, getOwner, getOwnerData, hasData, matchOwner
-
Field Details
-
CREATOR
-
-
Constructor Details
-
EditOperation
Constructs an edit operation from a text input operation on editor that replaces the oldText starting at dstart with newText. -
EditOperation
-
-
Method Details
-
writeToParcel
Description copied from interface:Parcelable
The subclass implements the method to flatten its contents by calling the methods ofParcel
for its primitive values.- Parameters:
dest
- the parcel to write the object's data toflags
- the flags about how the object should be written
-
commit
public void commit()Description copied from class:UndoOperation
Called when this undo state is being committed to the undo stack. The implementation should perform the initial edits and save any state that may be needed to undo them.- Specified by:
commit
in classUndoOperation<Editor>
-
undo
public void undo()Description copied from class:UndoOperation
Called when this undo state is being popped off the undo stack (in to the temporary redo stack). The implementation should remove the original edits and thus restore the target object to its prior value.- Specified by:
undo
in classUndoOperation<Editor>
-
redo
public void redo()Description copied from class:UndoOperation
Called when this undo state is being pushed back from the transient redo stack to the main undo stack. The implementation should re-apply the edits that were previously removed byUndoOperation.undo()
.- Specified by:
redo
in classUndoOperation<Editor>
-
forceMergeWith
Forcibly creates a single merged edit operation by simulating the entire text contents being replaced. -
toString
-