![]() |
API
0.9.7
|
A general mechanism for user action "undo". More...
#import <CPUndoManager.h>
A general mechanism for user action "undo".
CPUndoManager provides a general mechanism supporting implementation of user action "undo" in applications. Essentially, it allows you to store sequences of messages and receivers that need to be invoked to undo or redo an action. The various methods in this class provide for grouping of sets of actions, execution of undo or redo actions, and tuning behavior parameters such as the size of the undo stack. Each application entity with its own editing history (e.g., a document) should have its own undo manager instance. Obtain an instance through a simple [[CPUndoManager
alloc
] init
] message.
Definition at line 2 of file CPUndoManager.h.
|
implementation |
Starts a new grouping of undo tasks, and makes it the current grouping.
Definition at line 429 of file CPUndoManager.j.
|
implementation |
Returns YES
if the user can perform a redo operation.
Definition at line 316 of file CPUndoManager.j.
|
implementation |
Returns YES
if the user can perform an undo operation.
Definition at line 328 of file CPUndoManager.j.
|
implementation |
Disables undo registrations.
Definition at line 562 of file CPUndoManager.j.
|
implementation |
Enables undo registrations. Calls to this method must be balanced with calls to disableUndoRegistration. So, if two disable calls were made, two enable calls are required to actually enable undo registration again.
Definition at line 510 of file CPUndoManager.j.
|
implementation |
Provided by category CPUndoManager(CPCoding).
Definition at line 866 of file CPUndoManager.j.
|
implementation |
Closes the current undo grouping.
CPInternalInconsistencyException | if no undo group is open |
Definition at line 461 of file CPUndoManager.j.
|
implementation |
Returns the number of undo/redo groups.
Definition at line 547 of file CPUndoManager.j.
|
implementation |
Returns YES
if the manager groups undo operations at every iteration of the run loop.
Definition at line 522 of file CPUndoManager.j.
|
implementation |
Initializes the undo manager
Definition at line 204 of file CPUndoManager.j.
|
implementation |
Provided by category CPUndoManager(CPCoding).
Definition at line 844 of file CPUndoManager.j.
|
implementation |
Returns YES
if the manager is currently performing a redo.
Definition at line 587 of file CPUndoManager.j.
|
implementation |
Returns YES
if the manager is currently performing an undo.
Definition at line 579 of file CPUndoManager.j.
|
implementation |
Returns YES
if undo registration is enabled.
Definition at line 570 of file CPUndoManager.j.
|
implementation |
Definition at line 801 of file CPUndoManager.j.
|
implementation |
Definition at line 814 of file CPUndoManager.j.
|
implementation |
Prepares the specified target for the undo action.
aTarget | the target to receive the action |
Definition at line 270 of file CPUndoManager.j.
|
implementation |
Performs the redo operation using the last grouping on the redo stack.
Definition at line 386 of file CPUndoManager.j.
|
implementation |
If the receiver can perform a redo, this method returns the action name previously associated with the top grouping with -setActionName
:. This name should identify the action to be redone.
nil
if no there's no redo on the stack. Definition at line 662 of file CPUndoManager.j.
|
implementation |
Returns the full localized title of the actions to be displayed as a menu item. This method first invokes [-redoActionName] and passes it to [-redoMenuTitleForUndoActionName:] and returns the result.
Definition at line 675 of file CPUndoManager.j.
Returns the localized title of the actions to be displayed as a menu item identified by actionName, by appending a localized command string like "Redo <localized(actionName)>".
Definition at line 685 of file CPUndoManager.j.
|
implementation |
Registers an undo operation. You invoke this method with the target of the undo action providing the selector which can perform the undo with the provided object. The object is often a dictionary of the identifying the attribute and their values before the change. The invocation will be added to the current grouping. If the registrations have been disabled through -disableUndoRegistration
, this method does nothing.
aTarget | the target for the undo invocation |
aSelector | the selector for the action message |
anObject | the argument for the action message |
CPInternalInconsistencyException | if no undo group is currently open |
Definition at line 249 of file CPUndoManager.j.
|
implementation |
Clears all redo and undo operations and enables undo registrations.
Definition at line 596 of file CPUndoManager.j.
|
implementation |
Removes any redo and undo operations that use the specified target.
aTarget | the target for which operations should be removed. |
Definition at line 615 of file CPUndoManager.j.
|
implementation |
Returns the CPRunLoopModes in which the receiver registers the -endUndoGrouping
processing when it -groupsByEvent
.
Definition at line 743 of file CPUndoManager.j.
|
implementation |
Sets the name associated with the actions of the current group. Typically, you can call this method while registering the actions for the current group.
anActionName | the new name for the current group |
Definition at line 650 of file CPUndoManager.j.
|
implementation |
Sets whether the manager should group undo operations at every iteration of the run loop.
aFlag | YES groups undo operations |
Definition at line 531 of file CPUndoManager.j.
|
implementation |
Sets the modes in which the receiver registers the calls with the current run loop to invoke -endUndoGrouping
when it -groupsByEvent
. This method first cancels any pending registrations in the old modes and registers the invocation in the new modes.
modes | the modes in which calls are registered |
Definition at line 756 of file CPUndoManager.j.
|
implementation |
Definition at line 809 of file CPUndoManager.j.
|
implementation |
Ends the current grouping, and performs an 'undo' operation.
Definition at line 340 of file CPUndoManager.j.
|
implementation |
If the receiver can perform an undo, this method returns the action name previously associated with the top grouping with -setActionName
:. This name should identify the action to be undone.
nil
if no if there's no undo on the stack. Definition at line 703 of file CPUndoManager.j.
|
implementation |
Returns the full localized title of the actions to be displayed as a menu item. This method first invokes [-undoActionName] and passes it to [-undoMenuTitleForUndoActionName:] and returns the result.
Definition at line 716 of file CPUndoManager.j.
Returns the localized title of the actions to be displayed as a menu item identified by actionName, by appending a localized command string like "Undo <localized(actionName)>".
Definition at line 726 of file CPUndoManager.j.
|
implementation |
Performs an undo on the last undo group.
Definition at line 351 of file CPUndoManager.j.