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
* @see org.eclipse.core.commands.operations.IOperationHistory#execute(org.eclipse.core.commands.operations.IUndoableOperation,
	 *      org.eclipse.core.runtime.IProgressMonitor,
	 *      org.eclipse.core.runtime.IAdaptable)
	 */
	public IStatus execute(IUndoableOperation operation,
			IProgressMonitor monitor, IAdaptable info)
			throws ExecutionException {
		Assert.isNotNull(operation);
		
		if (!operation.canExecute()) {
			return IOperationHistory.OPERATION_INVALID_STATUS;
		}
		/*
		 * If we are in the middle of an open composite, then we will add this
		 * operation to the open operation rather than add the operation to the
		 * history. We will still execute it.
		 */
		boolean merging = false;
		synchronized (openCompositeLock) {
			if (openComposite != null) {
				
				
				
				if (openComposite == operation) {
					return IOperationHistory.OPERATION_INVALID_STATUS;
				}
				openComposite.add(operation);
				merging = true;
			}
		}