Class Editor.EditOperation

java.lang.Object
icyllis.modernui.core.UndoOperation<Editor>
icyllis.modernui.widget.Editor.EditOperation
All Implemented Interfaces:
Parcelable
Enclosing class:
Editor

public static class Editor.EditOperation extends UndoOperation<Editor>
An operation to undo a single "edit" to a text view.
  • Field Details

  • Constructor Details

    • EditOperation

      public 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.
    • EditOperation

      public EditOperation(Parcel src, ClassLoader loader)
  • Method Details

    • writeToParcel

      public void writeToParcel(@NonNull Parcel dest, int flags)
      Description copied from interface: Parcelable
      The subclass implements the method to flatten its contents by calling the methods of Parcel for its primitive values.
      Parameters:
      dest - the parcel to write the object's data to
      flags - 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 class UndoOperation<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 class UndoOperation<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 by UndoOperation.undo().
      Specified by:
      redo in class UndoOperation<Editor>
    • forceMergeWith

      public void forceMergeWith(Editor.EditOperation edit)
      Forcibly creates a single merged edit operation by simulating the entire text contents being replaced.
    • toString

      public String toString()
      Overrides:
      toString in class Object