public static class Editor.EditOperation extends UndoOperation<Editor>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.ClassLoaderCreator<Editor.EditOperation> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
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(Parcel src,
ClassLoader loader) |
Modifier and Type | Method and 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()
Returns a string representation of the object.
|
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)
Flatten this object in to a Parcel.
|
allowMerge, describeContents, getOwner, getOwnerData, hasData, matchOwner
public static final Parcelable.ClassLoaderCreator<Editor.EditOperation> CREATOR
public EditOperation(Editor editor, String oldText, int dstart, String newText)
public EditOperation(Parcel src, ClassLoader loader)
public void writeToParcel(Parcel dest, int flags)
Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public void commit()
UndoOperation
commit
in class UndoOperation<Editor>
public void undo()
UndoOperation
undo
in class UndoOperation<Editor>
public void redo()
UndoOperation
UndoOperation.undo()
.redo
in class UndoOperation<Editor>
public void forceMergeWith(Editor.EditOperation edit)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())