PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION);
redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
registerUndoRedoAction(ITextEditorActionConstants.REDO, redoAction);
// Install operation approvers
IOperationHistory history= OperationHistoryFactory.getOperationHistory();
// The first approver will prompt when operations affecting outside elements are to be undone or redone.
if (fNonLocalOperationApprover != null)
history.removeOperationApprover(fNonLocalOperationApprover);
fNonLocalOperationApprover= getUndoRedoOperationApprover(undoContext);
history.addOperationApprover(fNonLocalOperationApprover);
// The second approver will prompt from this editor when an undo is attempted on an operation
// and it is not the most recent operation in the editor.
if (fLinearUndoViolationApprover != null)
history.removeOperationApprover(fLinearUndoViolationApprover);
fLinearUndoViolationApprover= new LinearUndoViolationUserApprover(undoContext, this);
history.addOperationApprover(fLinearUndoViolationApprover);
} else {
// Use text operation actions (pre 3.1 style)
ResourceAction action;