Bug 123972 [Undo] Support approval of undoable operation execution
In GMF we do some common validation on our commands before we proceed to execute, undo or redo them. This validation is external to the command's ability to execute, undo or redo itself. Registering an IOperationApprover with the operation history for this of validation would give us an elegant solution. However, the IOperationApprover only supports approval of undo and redo. We also require support for approval of operation execution. Would you consider adding a proceedExecuting() method to the IOperationApprover interface, or to an extension of the IOperationApprover interface?
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/DefaultOperationHistory.java
}
		}
		if (checkUndoLimit(operation)) {
			synchronized (undoRedoHistoryLock) {
				undoList.add(operation);
			}
			notifyAdd(operation);
			
			IUndoContext[] contexts = operation.getContexts();
			for (int i = 0; i < contexts.length; i++) {
				flushRedo(contexts[i]);
			}
		}
	}
	/**
	 * <p>
	 * Add the specified approver to the list of operation approvers consulted
	 * by the operation history before an undo or redo is allowed to proceed.
	 * This method has no effect if the instance being added is already in the
	 * list.
	 * </p>
	 * <p>
	 * Operation approvers must be prepared to receive these the operation
	 * approval messages from a background thread. Any UI access occurring
	 * inside the implementation must be properly synchronized using the
	 * techniques specified by the client's widget library.
	 * </p>
	 * 
	 * @param approver
	 *            the IOperationApprover to be added as an approver.