public abstract class LinearUndoViolationDetector extends Object implements IOperationApprover
An abstract class for detecting violations in a strict linear undo/redo model. Once a violation is detected, subclasses implement the specific behavior for indicating whether or not the undo/redo should proceed.
Constructor and Description |
---|
LinearUndoViolationDetector()
Create an instance of LinearUndoViolationDetector.
|
Modifier and Type | Method and Description |
---|---|
protected abstract IStatus |
allowLinearRedoViolation(IUndoableOperation operation,
IUndoContext context,
IOperationHistory history,
IAdaptable info)
Return a status indicating whether a linear redo violation is allowable.
|
protected abstract IStatus |
allowLinearUndoViolation(IUndoableOperation operation,
IUndoContext context,
IOperationHistory history,
IAdaptable info)
Return a status indicating whether a linear undo violation is allowable.
|
IStatus |
proceedRedoing(IUndoableOperation operation,
IOperationHistory history,
IAdaptable info)
Return a status indicating whether the specified operation should be
redone.
|
IStatus |
proceedUndoing(IUndoableOperation operation,
IOperationHistory history,
IAdaptable info)
Return a status indicating whether the specified operation should be
undone.
|
public LinearUndoViolationDetector()
protected abstract IStatus allowLinearRedoViolation(IUndoableOperation operation, IUndoContext context, IOperationHistory history, IAdaptable info)
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 operationinfo
- the IAdaptable (or null
) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null
, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.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.protected abstract IStatus allowLinearUndoViolation(IUndoableOperation operation, IUndoContext context, IOperationHistory history, IAdaptable info)
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 operationinfo
- the IAdaptable (or null
) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null
, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.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.public final IStatus proceedRedoing(IUndoableOperation operation, IOperationHistory history, IAdaptable info)
IOperationApprover
IStatus.OK
will not be approved. Implementers should not assume that the redo will
be performed when the status is OK
, since other operation
approvers may veto the redo.proceedRedoing
in interface IOperationApprover
operation
- the operation to be redonehistory
- the history redoing the operationinfo
- the IAdaptable (or null
) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null
, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class. Even if UI
information is provided, the implementation of this method
must be prepared for being called from a background thread.
Any UI access must be properly synchronized using the
techniques specified by the client's widget library.OK
, and the caller requesting the redo will be
returned the status that caused the rejection. Any other status
severities will not be interpreted by the history.public final IStatus proceedUndoing(IUndoableOperation operation, IOperationHistory history, IAdaptable info)
IOperationApprover
IStatus.OK
will not be approved. Implementers should not assume that the undo will
be performed when the status is OK
, since other operation
approvers can veto the undo.proceedUndoing
in interface IOperationApprover
operation
- the operation to be undonehistory
- the history undoing the operationinfo
- the IAdaptable (or null
) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null
, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class. Even if UI
information is provided, the implementation of this method
must be prepared for being called from a background thread.
Any UI access must be properly synchronized using the
techniques specified by the client's widget library.OK
, and the caller requesting the undo will be
returned the status that caused the rejection. Any other status
severities will not be interpreted by the history.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.