Execute the specified operation and add it to the operations history if successful. This method is used by clients who wish operation history listeners to receive notifications before and after the execution of the operation. Execution of the operation is subject to approval by any registered {@link IOperationApprover2}. If execution is approved, listeners will be notified before (ABOUT_TO_EXECUTE
) and after (DONE
or OPERATION_NOT_OK
).
If the operation successfully executes, an additional notification that the operation has been added to the history (OPERATION_ADDED
) will be sent.
@param operation the operation to be executed and then added to the history
@param monitor the progress monitor to be used (or
null
) during the operation.
@param info 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.
@return the IStatus indicating whether the execution succeeded.
The severity code in the returned status describes whether the operation succeeded and whether it was added to the history. OK
severity indicates that the execute operation was successful and that the operation has been added to the history. Listeners will receive notifications about the operation's success (DONE
) and about the operation being added to the history (OPERATION_ADDED
).
CANCEL
severity indicates that the user cancelled the operation and that the operation was not added to the history. ERROR
severity indicates that the operation did not successfully execute and that it was not added to the history. Any other severity code is not specifically interpreted by the history, and the operation will not be added to the history. For all severities other than OK
, listeners will receive the OPERATION_NOT_OK
notification instead of the DONE
notification if the execution was approved and attempted.
@throws ExecutionException if an exception occurred during execution.