| java.lang.Object org.eclipse.ui.operations.NonLocalUndoUserApprover
NonLocalUndoUserApprover | final public class NonLocalUndoUserApprover implements IOperationApprover(Code) | |
An operation approver that prompts the user to see if a non-local undo should
proceed inside an editor. A non-local undo is detected when an operation
being undone or redone affects elements other than those described by the
editor itself. Clients can optionally specify a class, the preferred
comparison class, that should be used when comparing objects affected by the
editor with objects affected by an undo or redo operation. Comparisons
between the affected objects inside the editor and those described by the
operation will first be done by simply performing an equality check, using
java.lang.Object.equals(java.lang.Object) . If an object described by
an operation is not equal to one of the objects affected by the editor, and
if it is not an instance of the preferred comparison class, but is an
instance of
org.eclipse.core.runtime.IAdaptable , then the operation
approver will also attempt to retrieve an adapter on that object for the
preferred comparison class and perform a second equality check using the
adapter.
This class may be instantiated by clients.
since: 3.1 |
Constructor Summary | |
public | NonLocalUndoUserApprover(IUndoContext context, IEditorPart part, Object[] affectedObjects, Class preferredComparisonClass) Create a NonLocalUndoUserApprover associated with the specified editor
and undo context
Parameters: context - the undo context of operations in question. Parameters: part - the editor part that is displaying the element Parameters: affectedObjects - the objects that are affected by the editor and considered tobe objects local to the editor. |
Method Summary | |
public IStatus | proceedRedoing(IUndoableOperation operation, IOperationHistory history, IAdaptable uiInfo) | public IStatus | proceedUndoing(IUndoableOperation operation, IOperationHistory history, IAdaptable uiInfo) |
NonLocalUndoUserApprover | public NonLocalUndoUserApprover(IUndoContext context, IEditorPart part, Object[] affectedObjects, Class preferredComparisonClass)(Code) | | Create a NonLocalUndoUserApprover associated with the specified editor
and undo context
Parameters: context - the undo context of operations in question. Parameters: part - the editor part that is displaying the element Parameters: affectedObjects - the objects that are affected by the editor and considered tobe objects local to the editor. The objects are typicallyinstances of the preferredComparisonClass or else provideadapters for the preferredComparisonClass, although this isnot required. Parameters: preferredComparisonClass - the preferred class to be used when comparing the editor'saffectedObjects with those provided by the undoable operationusingorg.eclipse.core.commands.operations.IAdvancedUndoableOperation.getAffectedObjects.If the operation's affected objects are not instances of thespecified class, but are instances oforg.eclipse.core.runtime.IAdaptable, then an adapterfor this class will be requested. The preferredComparisonClassmay be null , which indicates that there is noexpected class or adapter necessary for the comparison. |
proceedRedoing | public IStatus proceedRedoing(IUndoableOperation operation, IOperationHistory history, IAdaptable uiInfo)(Code) | | |
proceedUndoing | public IStatus proceedUndoing(IUndoableOperation operation, IOperationHistory history, IAdaptable uiInfo)(Code) | | |
|
|