Classes for the creation of undoable operations which can be added to an operations history and later be undone and redone.
Package SpecificationAn undoable operation is a unit of work that can be executed, undone, and redone. Operations can be added to an operation history so that they can later be undone and redone according to the undo model for an application. Operations may be assigned one or more undo contexts which can be used to filter the available operations for undo or redo in the operation history. Clients may choose to provide undo and redo function for all operations in a history, or only for a particular undo context in that history. Operation histories may be configured with an operation approver so that applications can enforce any desired undo model, such as strict linear (LIFO) undo. This package provides the definition and a basic implementation for operations, undo contexts, histories, and operation approvers.
Interface Summary Interface Description IAdvancedUndoableOperationIAdvancedUndoableOperation defines an interface for undoable operations that modify one or more elements in a model and attempt to keep model listeners up to date with changes that occur in the undo and redo history involving particular model elements. IAdvancedUndoableOperation2IAdvancedUndoableOperation2 defines a method for computing the validity of executing an operation before attempting to execute it. ICompositeOperationICompositeOperation defines an undoable operation that is composed of child operations. IContextReplacingOperationIContextReplacingOperation defines an interface for undoable operations that can replace one undo context with another undo context. IOperationApproverIOperationApprover defines an interface for approving the undo or redo of a particular operation within an operation history. IOperationApprover2Extends
IOperationApproverto approve the execution of a particular operation within an operation history.
IOperationHistoryIOperationHistory tracks a history of operations that can be undone or redone. IOperationHistoryListenerThis interface is used to listen to notifications from an IOperationHistory. IUndoableOperationIUndoableOperation defines an operation that can be executed, undone, and redone. IUndoContextAn undo context is used to "tag" operations as being applicable to a certain context.
Class Summary Class Description AbstractOperationAbstract implementation for an undoable operation. DefaultOperationHistoryA base implementation of IOperationHistory that implements a linear undo and redo model . LinearUndoEnforcerAn operation approver that enforces a strict linear undo. LinearUndoViolationDetectorAn abstract class for detecting violations in a strict linear undo/redo model. ObjectUndoContextAn undo context that can be used to represent any given object. OperationHistoryEventOperationHistoryEvent is used to communicate changes that occur in a DefaultOperationHistory, including the addition or removal of operations, and the execution, undo, and redo of operations. OperationHistoryFactoryThis class is used to maintain the instance of the operation history that should be used by classes that access the undo or redo history and add undoable operations to the history. OperationStatusOperationStatus describes the status of a request to execute, undo, or redo an operation. TriggeredOperationsTriggered operations are a specialized implementation of a composite operation that keeps track of operations triggered by the execution of some primary operation. UndoContextA simple, lightweight undo context that can be used to tag any operation.