Package icyllis.modernui.widget

# 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.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface icyllis.modernui.util.Parcelable

  `Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>, Parcelable.WriteFlags`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Parcelable.ClassLoaderCreator<Editor.EditOperation>`
  `CREATOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EditOperation(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 Type
  Method
  Description
  `void`
  `commit()`
  Called when this undo state is being committed to the undo stack.
  `void`
  `forceMergeWith(Editor.EditOperation edit)`
  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.
  `String`
  `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 of `Parcel` for its primitive values.

  ### Methods inherited from class icyllis.modernui.core.UndoOperation

  `allowMerge, getOwner, getOwnerData, hasData, matchOwner`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### CREATOR

    public static final Parcelable.ClassLoaderCreator<Editor.EditOperation> CREATOR

- ## 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`