Package org.eclipse.ui.operations
Class LinearUndoViolationUserApprover
java.lang.Object
org.eclipse.core.commands.operations.LinearUndoViolationDetector
org.eclipse.ui.operations.LinearUndoViolationUserApprover
- All Implemented Interfaces:
IOperationApprover
An operation approver that prompts the user to see if linear undo violations are permitted. A linear undo violation is detected when an operation being undone or redone shares an undo context with another operation appearing more recently in the history.
This class may be instantiated by clients.
- Since:
- 3.1
-
Constructor Summary
ConstructorDescriptionLinearUndoViolationUserApprover
(IUndoContext context, IWorkbenchPart part) Create a LinearUndoViolationUserApprover associated with the specified workbench part. -
Method Summary
Modifier and TypeMethodDescriptionprotected IStatus
allowLinearRedoViolation
(IUndoableOperation operation, IUndoContext context, IOperationHistory history, IAdaptable uiInfo) Return a status indicating whether a linear redo violation is allowable.protected IStatus
allowLinearUndoViolation
(IUndoableOperation operation, IUndoContext context, IOperationHistory history, IAdaptable uiInfo) Return a status indicating whether a linear undo violation is allowable.Methods inherited from class org.eclipse.core.commands.operations.LinearUndoViolationDetector
proceedRedoing, proceedUndoing
-
Constructor Details
-
LinearUndoViolationUserApprover
Create a LinearUndoViolationUserApprover associated with the specified workbench part.- Parameters:
context
- the undo context with the linear undo violationpart
- the part that should be used for prompting the user
-
-
Method Details
-
allowLinearRedoViolation
protected IStatus allowLinearRedoViolation(IUndoableOperation operation, IUndoContext context, IOperationHistory history, IAdaptable uiInfo) Description copied from class:LinearUndoViolationDetector
Return a status indicating whether a linear redo violation is allowable. A linear redo violation is defined as a request to redo a particular operation even if it is not the most recently added operation to the redo history.- Specified by:
allowLinearRedoViolation
in classLinearUndoViolationDetector
- Parameters:
operation
- the operation for which a linear redo violation has been detected.context
- the undo context in which the linear redo violation existshistory
- the operation history containing the operationuiInfo
- the IAdaptable (ornull
) provided by the caller in order to supply UI information for prompting the user if necessary. When this parameter is notnull
, it should minimally contain an adapter for the org.eclipse.swt.widgets.Shell.class.- Returns:
- the IStatus describing whether the redo violation is allowed. The
redo will not proceed if the status severity is not
OK
, and the caller requesting the redo will be returned the status that caused the rejection. Specific status severities will not be interpreted by the history.
-
allowLinearUndoViolation
protected IStatus allowLinearUndoViolation(IUndoableOperation operation, IUndoContext context, IOperationHistory history, IAdaptable uiInfo) Description copied from class:LinearUndoViolationDetector
Return a status indicating whether a linear undo violation is allowable. A linear undo violation is defined as a request to undo a particular operation even if it is not the most recently added operation to the undo history.- Specified by:
allowLinearUndoViolation
in classLinearUndoViolationDetector
- Parameters:
operation
- the operation for which a linear undo violation has been detected.context
- the undo context in which the linear undo violation existshistory
- the operation history containing the operationuiInfo
- the IAdaptable (ornull
) provided by the caller in order to supply UI information for prompting the user if necessary. When this parameter is notnull
, it should minimally contain an adapter for the org.eclipse.swt.widgets.Shell.class.- Returns:
- the IStatus describing whether the undo violation is allowed. The
undo will not proceed if the status severity is not
OK
, and the caller requesting the undo will be returned the status that caused the rejection. Specific status severities will not be interpreted by the history.
-