OperationHistoryActionHandler implements common behavior for the undo and
redo actions. It supports filtering of undo or redo on a particular undo
context. If an undo context is not specified, or there has been no history
available for the specified undo context, then the workbench undo context
will be used.
OperationHistoryActionHandler provides an adapter in the info parameter of
the IOperationHistory undo and redo methods that is used to get UI info for
prompting the user during operations or operation approval. Adapters are
provided for org.eclipse.ui.IWorkbenchWindow, org.eclipse.swt.widgets.Shell,
org.eclipse.ui.IWorkbenchPart, org.eclipse.core.commands.IUndoContext, and
org.eclipse.runtime.IProgressMonitor.
OperationHistoryActionHandler assumes a linear undo/redo model. When the
handler is run, the operation history is asked to perform the most recent
undo/redo for the handler's undo context. The handler can be configured
(using #setPruneHistory(true)) to flush the operation undo or redo history
for the handler's undo context when there is no valid operation on top of the
history. This avoids keeping a stale history of invalid operations. By
default, pruning does not occur and it is assumed that clients of the
particular undo context are pruning the history when necessary.
since: 3.1 |