Bug 94438 [Undo] - javadoc - clarify operation remaining in history for undo/redo with INFO/WARNING
The javadoc for the IOperationHistory#undo(...) redo(...) methods is very explicit about the operation remaining in the history on CANCEL and ERROR status, and that it is moved between undo/redo histories when ok. Some minor clarifications: The lack of an explicit statement about INFO and WARNING makes one wonder what happens to the operation. It remains in the history in this case also... Technically, on OK status the operation is not guaranteed to move between the stacks. If it cannot redo after undoing, or cannot undo after redoing, it won't be transferred to the other stack, but in effect will be removed from the history.
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IOperationHistory.java
* context.
 * </p>
 * <p>
 * Additional protocol allows direct undo and redo of a specified operation,
 * regardless of its position in the history. When a more flexible undo model is
 * supported, these methods can be implemented to undo and redo directly
 * specified operations. If an implementer of IOperationHistory does not allow
 * direct undo and redo, these methods can return a status indicating that it is
 * not allowed.
 * </p>
 * <p>
 * Listeners (IOperationHistoryListener) can listen for notifications about
 * changes in the history (operations added or removed), and for notification
 * before and after any operation is executed, undone or redone. Notification of
 * operation execution only occurs when clients direct the history to execute
 * the operation. If the operation is added after it is executed, there can be
 * no notification of its execution.
 * </p>
 * <p>
 * IOperationApprover defines an interface for approving an undo or redo before
 * it occurs. This is useful for injecting policy-decisions into the model -
 * whether direct undo and redo are supported, or warning the user about certain
 * kinds of operations. It can also be used when objects have state related to
 * the operation and need to determine whether an undo or redo will cause any
 * conflicts with their local state.
 * </p>
 * 
 * @since 3.1
 */
public interface IOperationHistory {