public abstract class UndoOperation<DATA> extends Object implements Parcelable
UndoManager
.Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
protected |
UndoOperation(Parcel src,
ClassLoader loader)
Construct from a Parcel.
|
|
UndoOperation(UndoOwner owner)
Create a new instance of the operation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowMerge()
Return true if this operation can be merged with a later operation.
|
abstract void |
commit()
Called when this undo state is being committed to the undo stack.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
UndoOwner |
getOwner()
Owning object as given to
UndoOperation(UndoOwner) . |
DATA |
getOwnerData()
Synonym for
getOwner() . |
boolean |
hasData()
Return true if this operation actually contains modification data.
|
boolean |
matchOwner(UndoOwner owner)
Return true if this undo operation is a member of the given owner.
|
abstract void |
redo()
Called when this undo state is being pushed back from the transient
redo stack to the main undo stack.
|
abstract void |
undo()
Called when this undo state is being popped off the undo stack (in to
the temporary redo stack).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeToParcel
public UndoOperation(UndoOwner owner)
owner
- Who owns the data being modified by this undo state; must be
returned by UndoManager.getOwner
.protected UndoOperation(Parcel src, ClassLoader loader)
public UndoOwner getOwner()
UndoOperation(UndoOwner)
.public DATA getOwnerData()
getOwner()
.UndoOwner.getData()
.public boolean matchOwner(UndoOwner owner)
owner == getOwner()
. You
can override this to provide more sophisticated dependencies between
owners.public boolean hasData()
public boolean allowMerge()
public abstract void commit()
public abstract void undo()
public abstract void redo()
undo()
.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR