Class RMUndoer
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
Call: undoer.addDirtyObject(this) - This registers and objects for possible change Implement: undoClone() or clone() - A typical clone implementation should do, except that all relationship objects should be copied deep unless they also register with addDirtyObject(). Objects are copied the first time they are sent to addDirtyObject(). Implement: undoEquals() or equals() - A typical equals implementation should do. At the end of the current event, objects that end up being equal to their registered clone are trimmed to avoid unecessary archival (and no-op undo events). Implement: undoCopy(anObj) or copy(anObj) - This method should restore the state of an object from its registered clone. All relationship objects should be copied deep, unless they also register with addDirtyObject().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This class reprents a distinct "undoable event". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDirtyObject
(RMObject anObj) Adds the given object to the current undo record.allUndos()
Returns all undos (including the current one, if changes are pending).void
disable()
Disables undoer so it can receive new changes.void
enable()
Enables undoer.boolean
Returns whether undoer coalesces changes.int
Returns the number of dirty objects in the current undo record.int
Returns whether undoer is disabled.Returns most recent undo event.Returns the next redo event.Returns the last redo.Returns the list of objects that should be selected after current undo is redone.Returns the next undo event.Returns the last undo.Returns the list of objects that should be selected after current undo is fired.boolean
hasUndos()
Returns whether undoer has undoable changes stored away.boolean
isBenignChange
(String aString) Returns whether a given change doesn't really effect signficant state change.boolean
isDuplicate
(String aTitle, RMObject anObj) Returns whether given title is title of last undo.void
redo()
Pops last redo event off stack and has it update all changed objects it contains.redos()
Returns the list of redos.void
reset()
Resets the undoer to its initial state (good to do when a document is saved).void
Pushes current undo record on the stack and opens new one.void
setCoalesce
(boolean aFlag) Sets whether undoer coalesces changes.void
setDisabled
(int aValue) Sets whether undoer is disabled.void
setRedoSelectedObjects
(List aList) Sets the list of objects that should be selected after current undo is redone.void
setUndoSelectedObjects
(List aList) Sets the list of objects that should be selected after current undo is fired.void
setUndoTitle
(String aString) Sets the title of the current undo.void
undo()
Pops last undo event off stack an has it update all changed objects it contains.undos()
Returns the list of undos.Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
Constructor Details
-
RMUndoer
public RMUndoer()Creates a new undoer.
-
-
Method Details
-
getDirtyObjectCount
public int getDirtyObjectCount()Returns the number of dirty objects in the current undo record. -
addDirtyObject
Adds the given object to the current undo record. -
saveChanges
public void saveChanges()Pushes current undo record on the stack and opens new one. -
undo
public void undo()Pops last undo event off stack an has it update all changed objects it contains. -
redo
public void redo()Pops last redo event off stack and has it update all changed objects it contains. -
disable
public void disable()Disables undoer so it can receive new changes. -
enable
public void enable()Enables undoer. -
getDisabled
public int getDisabled()Returns whether undoer is disabled. -
setDisabled
public void setDisabled(int aValue) Sets whether undoer is disabled. -
getCoalesce
public boolean getCoalesce()Returns whether undoer coalesces changes. -
setCoalesce
public void setCoalesce(boolean aFlag) Sets whether undoer coalesces changes. -
getRecentUndo
Returns most recent undo event. -
reset
public void reset()Resets the undoer to its initial state (good to do when a document is saved). -
isBenignChange
Returns whether a given change doesn't really effect signficant state change. -
hasUndos
public boolean hasUndos()Returns whether undoer has undoable changes stored away. -
getUndoEvent
Returns the next undo event. -
getRedoEvent
Returns the next redo event. -
setUndoTitle
Sets the title of the current undo. -
undos
Returns the list of undos. -
redos
Returns the list of redos. -
getUndoLast
Returns the last undo. -
getRedoLast
Returns the last redo. -
allUndos
Returns all undos (including the current one, if changes are pending). -
getUndoSelectedObjects
Returns the list of objects that should be selected after current undo is fired. -
setUndoSelectedObjects
Sets the list of objects that should be selected after current undo is fired. -
getRedoSelectedObjects
Returns the list of objects that should be selected after current undo is redone. -
setRedoSelectedObjects
Sets the list of objects that should be selected after current undo is redone. -
isDuplicate
Returns whether given title is title of last undo.
-