KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > commands > operations > IOperationHistory


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.commands.operations;
12
13 import org.eclipse.core.commands.ExecutionException;
14 import org.eclipse.core.internal.commands.operations.GlobalUndoContext;
15 import org.eclipse.core.runtime.IAdaptable;
16 import org.eclipse.core.runtime.IProgressMonitor;
17 import org.eclipse.core.runtime.IStatus;
18
19 /**
20  * <p>
21  * IOperationHistory tracks a history of operations that can be undone or
22  * redone. Operations are added to the history once they have been initially
23  * executed. Clients may choose whether to have the operations history perform
24  * the initial execution or to simply add an already-executed operation to the
25  * history.
26  * </p>
27  * <p>
28  * Once operations are added to the history, the methods
29  * {@link #canRedo(IUndoContext)} and {@link #canUndo(IUndoContext)} are used to
30  * determine whether there is an operation available for undo and redo in a
31  * given undo context. The context-based protocol implies that there is only one
32  * operation that can be undone or redone at a given time in a given context.
33  * This is typical of a linear undo model, when only the most recently executed
34  * operation is available for undo. When this protocol is used, a linear model
35  * is enforced by the history.
36  * </p>
37  * <p>
38  * It is up to clients to determine how to maintain a history that is invalid or
39  * stale. For example, when the most recent operation for a context cannot be
40  * performed, clients may wish to dispose the history for that context.
41  * </p>
42  * <p>
43  * Additional protocol allows direct undo and redo of a specified operation,
44  * regardless of its position in the history. When a more flexible undo model is
45  * supported, these methods can be implemented to undo and redo directly
46  * specified operations. If an implementer of IOperationHistory does not allow
47  * direct undo and redo, these methods can return a status indicating that it is
48  * not allowed.
49  * </p>
50  * <p>
51  * Listeners ({@link IOperationHistoryListener}) can listen for notifications
52  * about changes in the history (operations added or removed), and for
53  * notification before and after any operation is executed, undone or redone.
54  * Notification of operation execution only occurs when clients direct the
55  * history to execute the operation. If the operation is added after it is
56  * executed, there can be no notification of its execution.
57  * </p>
58  * <p>
59  * {@link IOperationApprover} defines an interface for approving an undo or redo
60  * before it occurs. This is useful for injecting policy-decisions into the undo
61  * model - whether direct undo and redo are supported, or warning the user about
62  * certain kinds of operations. It can also be used when clients maintain state
63  * related to an operation and need to determine whether an undo or redo will
64  * cause any conflicts with their local state.
65  * </p>
66  *
67  * @since 3.1
68  */

69 public interface IOperationHistory {
70
71     /**
72      * An operation is to be opened or closed for execution. (value is 1).
73      */

74     public static final int EXECUTE = 1;
75
76     /**
77      * An operation is to be opened for undo. (value is 2).
78      */

79     public static final int UNDO = 2;
80
81     /**
82      * An operation is to be opened for redo. (value is 3).
83      */

84     public static final int REDO = 3;
85
86     /**
87      * An undo context that can be used to refer to the global undo history.
88      * This context is not intended to be assigned to operations. Instead, it is
89      * used for querying the history or performing an undo or redo on the entire
90      * history, regardless of each operation's undo contexts.
91      */

92     public static final IUndoContext GLOBAL_UNDO_CONTEXT = new GlobalUndoContext();
93
94     /**
95      * An operation info status describing the condition that there is no
96      * available operation for redo.
97      */

98     public static final IStatus NOTHING_TO_REDO_STATUS = new OperationStatus(
99             IStatus.INFO, OperationStatus.DEFAULT_PLUGIN_ID,
100             OperationStatus.NOTHING_TO_REDO, "No operation to redo", null); //$NON-NLS-1$
101

102     /**
103      * An operation info status describing the condition that there is no
104      * available operation for undo.
105      */

106     public static final IStatus NOTHING_TO_UNDO_STATUS = new OperationStatus(
107             IStatus.INFO, OperationStatus.DEFAULT_PLUGIN_ID,
108             OperationStatus.NOTHING_TO_UNDO, "No operation to undo", null); //$NON-NLS-1$
109

110     /**
111      * An operation error status describing the condition that the operation
112      * available for execution, undo or redo is not in a valid state for the
113      * action to be performed.
114      */

115     public static final IStatus OPERATION_INVALID_STATUS = new OperationStatus(
116             IStatus.ERROR, OperationStatus.DEFAULT_PLUGIN_ID,
117             OperationStatus.OPERATION_INVALID, "Operation is not valid", null); //$NON-NLS-1$
118

119     /**
120      * <p>
121      * Add the specified operation to the history without executing it. The
122      * operation should have already been executed by the time it is added to
123      * the history. Listeners will be notified that the operation was added to
124      * the history (<code>OPERATION_ADDED</code>).
125      * </p>
126      *
127      * @param operation
128      * the operation to be added to the history
129      */

130     void add(IUndoableOperation operation);
131
132     /**
133      * <p>
134      * Add the specified approver to the list of operation approvers consulted
135      * by the operation history before an undo or redo is attempted.
136      * </p>
137      *
138      * @param approver
139      * the IOperationApprover to be added as an approver.the instance
140      * to remove. Must not be <code>null</code>. If an attempt is
141      * made to register an instance which is already registered with
142      * this instance, this method has no effect.
143      *
144      * @see org.eclipse.core.commands.operations.IOperationApprover
145      */

146     void addOperationApprover(IOperationApprover approver);
147
148     /**
149      * <p>
150      * Add the specified listener to the list of operation history listeners
151      * that are notified about changes in the history or operations that are
152      * executed, undone, or redone.
153      * </p>
154      *
155      * @param listener
156      * the IOperationHistoryListener to be added as a listener. Must
157      * not be <code>null</code>. If an attempt is made to register
158      * an instance which is already registered with this instance,
159      * this method has no effect.
160      *
161      * @see org.eclipse.core.commands.operations.IOperationHistoryListener
162      * @see org.eclipse.core.commands.operations.OperationHistoryEvent
163      */

164     void addOperationHistoryListener(IOperationHistoryListener listener);
165
166     /**
167      * <p>
168      * Close the current operation. If the operation has successfully completed,
169      * send listeners a <code>DONE</code>, <code>UNDONE</code>, or
170      * <code>REDONE</code> notification, depending on the mode. Otherwise send
171      * an <code>OPERATION_NOT_OK</code> notification. Add the operation to the
172      * history if specified and send an <code>OPERATION_ADDED</code>
173      * notification.
174      * </p>
175      * <p>
176      * Any operations that are executed and added after this operation is closed
177      * will no longer be considered part of this operation.
178      * </p>
179      * <p>
180      * This method has no effect if the caller has not previously called
181      * {@link #openOperation}.
182      * </p>
183      *
184      * @param operationOK
185      * <code>true</code> if the operation successfully completed.
186      * Listeners should be notified with <code>DONE</code>,
187      * <code>UNDONE</code>, or <code>REDONE</code>.
188      * <code>false</code> if the operation did not successfully
189      * complete. Listeners should be notified with
190      * <code>OPERATION_NOT_OK</code>.
191      * @param addToHistory
192      * <code>true</code> if the operation should be added to the
193      * history, <code>false</code> if it should not. If the
194      * <code>operationOK</code> parameter is <code>false</code>,
195      * the operation will never be added to the history.
196      * @param mode
197      * the mode the operation was opened in. Can be one of
198      * <code>EXECUTE</code>, <code>UNDO</code>, or
199      * <code>REDO</code>. This determines what notifications are
200      * sent.
201      */

202     void closeOperation(boolean operationOK, boolean addToHistory, int mode);
203
204     /**
205      * <p>
206      * Return whether there is a valid redoable operation available in the given
207      * context.
208      * </p>
209      *
210      * @param context
211      * the context to be checked
212      * @return <code>true</code> if there is a redoable operation,
213      * <code>false</code> otherwise.
214      */

215
216     boolean canRedo(IUndoContext context);
217
218     /**
219      * <p>
220      * Return whether there is a valid undoable operation available in the given
221      * context
222      * </p>
223      *
224      * @param context
225      * the context to be checked
226      * @return <code>true</code> if there is an undoable operation,
227      * <code>false</code> otherwise.
228      */

229     boolean canUndo(IUndoContext context);
230
231     /**
232      * <p>
233      * Dispose of the specified context in the history. All operations that have
234      * only the given context will be disposed. References to the context in
235      * operations that have more than one context will also be removed. A
236      * history notification for the removal of each operation being disposed
237      * will be sent.
238      * </p>
239      *
240      * @param context
241      * the context to be disposed
242      * @param flushUndo
243      * <code>true</code> if the context should be flushed from the
244      * undo history, <code>false</code> if it should not
245      * @param flushRedo
246      * <code>true</code> if the context should be flushed from the
247      * redo history, <code>false</code> if it should not.
248      * @param flushContext
249      * <code>true</code> if the context is no longer in use and
250      * references to it should be flushed.
251      */

252     void dispose(IUndoContext context, boolean flushUndo, boolean flushRedo,
253             boolean flushContext);
254
255     /**
256      * <p>
257      * Execute the specified operation and add it to the operations history if
258      * successful. This method is used by clients who wish operation history
259      * listeners to receive notifications before and after the execution of the
260      * operation. Execution of the operation is subject to approval by any
261      * registered {@link IOperationApprover2}. If execution is approved,
262      * listeners will be notified before (<code>ABOUT_TO_EXECUTE</code>) and
263      * after (<code>DONE</code> or <code>OPERATION_NOT_OK</code>).
264      * </p>
265      * <p>
266      * If the operation successfully executes, an additional notification that
267      * the operation has been added to the history (<code>OPERATION_ADDED</code>)
268      * will be sent.
269      * </p>
270      *
271      * @param operation
272      * the operation to be executed and then added to the history
273      *
274      * @param monitor
275      * the progress monitor to be used (or <code>null</code>)
276      * during the operation.
277      *
278      * @param info
279      * the IAdaptable (or <code>null</code>) provided by the
280      * caller in order to supply UI information for prompting the
281      * user if necessary. When this parameter is not
282      * <code>null</code>, it should minimally contain an adapter
283      * for the org.eclipse.swt.widgets.Shell.class.
284      *
285      * @return the IStatus indicating whether the execution succeeded.
286      *
287      * <p>
288      * The severity code in the returned status describes whether the operation
289      * succeeded and whether it was added to the history. <code>OK</code>
290      * severity indicates that the execute operation was successful and that the
291      * operation has been added to the history. Listeners will receive
292      * notifications about the operation's success (<code>DONE</code>) and
293      * about the operation being added to the history (<code>OPERATION_ADDED</code>).
294      * </p>
295      * <p>
296      * <code>CANCEL</code> severity indicates that the user cancelled the
297      * operation and that the operation was not added to the history.
298      * <code>ERROR</code> severity indicates that the operation did not
299      * successfully execute and that it was not added to the history. Any other
300      * severity code is not specifically interpreted by the history, and the
301      * operation will not be added to the history. For all severities other than
302      * <code>OK</code>, listeners will receive the
303      * <code>OPERATION_NOT_OK</code> notification instead of the
304      * <code>DONE</code> notification if the execution was approved and
305      * attempted.
306      * </p>
307      *
308      * @throws ExecutionException
309      * if an exception occurred during execution.
310      *
311      */

312     IStatus execute(IUndoableOperation operation, IProgressMonitor monitor,
313             IAdaptable info) throws ExecutionException;
314
315     /**
316      * <p>
317      * Return the limit on the undo and redo history for a particular context.
318      * </p>
319      *
320      * @param context
321      * the context whose limit is requested
322      *
323      * @return the undo and redo history limit for the specified context.
324      */

325     int getLimit(IUndoContext context);
326
327     /**
328      * <p>
329      * Get the array of operations in the redo history for a the specified undo
330      * context. The operations are in the order that they were added to the
331      * history, with the most recently undone operation appearing last in the
332      * array. This history is used LIFO (last in, first out) when successive
333      * "Redo" commands are invoked.
334      *
335      * </p>
336      *
337      * @param context
338      * the context for the redo
339      * @return the array of operations in the history
340      */

341     IUndoableOperation[] getRedoHistory(IUndoContext context);
342
343     /**
344      * <p>
345      * Get the operation that will next be redone in the given undo context.
346      * </p>
347      *
348      * @param context
349      * the context for the redo
350      * @return the operation to be redone or <code>null</code> if there is no
351      * operation available. There is no guarantee that the returned
352      * operation is valid for redo.
353      */

354     IUndoableOperation getRedoOperation(IUndoContext context);
355
356     /**
357      * <p>
358      * Get the array of operations in the undo history for the specified undo
359      * context. The operations are in the order that they were added to the
360      * history, with the most recently added operation appearing last in the
361      * array. This history is used LIFO (last in, first out) when successive
362      * "Undo" commands are invoked.
363      * </p>
364      *
365      * @param context
366      * the context for the undo
367      * @return the array of operations in the history
368      */

369     IUndoableOperation[] getUndoHistory(IUndoContext context);
370
371     /**
372      * <p>
373      * Open this composite operation and consider it an operation that contains
374      * other related operations. Consider all operations that are subsequently
375      * executed or added to be part of this operation. When an operation is
376      * opened, listeners will immediately receive a notification for the opened
377      * operation. The specific notification depends on the mode in which the
378      * operation is opened (<code>ABOUT_TO_EXECUTE</code>,
379      * <code>ABOUT_TO_UNDO</code>, <code>ABOUT_TO_REDO</code>).
380      * Notifications for any other execute or add while this operation is open
381      * will not occur. Instead, those operations will be added to the current
382      * operation.
383      * </p>
384      * <p>
385      * Note: This method is intended to be used by legacy undo frameworks that
386      * do not expect related undo operations to appear in the same undo history
387      * as the triggering undo operation. When an operation is open, any
388      * subsequent requests to execute, add, undo, or redo another operation will
389      * result in that operation being added to the open operation. Once the
390      * operation is closed, the composite will be considered an atomic
391      * operation. Clients should not modify the composite directly (by adding
392      * and removing children) while it is open.
393      * </p>
394      * <p>
395      * When a composite is open, operations that are added to the history will
396      * be considered part of the open operation instead. Operations that are
397      * executed while a composite is open will first be executed and then added
398      * to the composite.
399      * </p>
400      * <p>
401      * Open operations cannot be nested. If this method is called when a
402      * different operation is open, it is presumed to be an application coding
403      * error and this method will throw an IllegalStateException.
404      * </p>
405      *
406      * @param operation
407      * the composite operation to be considered as the parent for all
408      * subsequent operations.
409      * @param mode
410      * the mode the operation is executing in. Can be one of
411      * <code>EXECUTE</code>, <code>UNDO</code>, or
412      * <code>REDO</code>. This determines what notifications are
413      * sent.
414      */

415     void openOperation(ICompositeOperation operation, int mode);
416
417     /**
418      * <p>
419      * The specified operation has changed in some way since it was added to the
420      * operation history. Notify listeners with an OPERATION_CHANGED event.
421      * </p>
422      *
423      * @param operation
424      * the operation that has changed.
425      *
426      */

427     void operationChanged(IUndoableOperation operation);
428
429     /**
430      * <p>
431      * Get the operation that will next be undone in the given undo context.
432      * </p>
433      *
434      * @param context
435      * the context for the undo
436      * @return the operation to be undone or <code>null</code> if there is no
437      * operation available. There is no guarantee that the available
438      * operation is valid for the undo.
439      */

440     IUndoableOperation getUndoOperation(IUndoContext context);
441
442     /**
443      * <p>
444      * Redo the most recently undone operation in the given context. The redo of
445      * the operation is subject to approval by any registered
446      * {@link IOperationApprover} before it is attempted.
447      * </p>
448      *
449      * @param context
450      * the context to be redone
451      * @param monitor
452      * the progress monitor to be used for the redo, or
453      * <code>null</code> if no progress monitor is provided.
454      * @param info
455      * the IAdaptable (or <code>null</code>) provided by the
456      * caller in order to supply UI information for prompting the
457      * user if necessary. When this parameter is not
458      * <code>null</code>, it should minimally contain an adapter
459      * for the org.eclipse.swt.widgets.Shell.class.
460      * @return the IStatus indicating whether the redo succeeded.
461      *
462      * <p>
463      * The severity code in the returned status describes whether the operation
464      * succeeded and whether it remains in the history. <code>OK</code>
465      * severity indicates that the redo operation was successful and (since
466      * release 3.2), that the operation will be placed in the undo history.
467      * (Prior to 3.2, a successfully redone operation would not be placed on the
468      * undo history if it could not be undone. Since 3.2, this is relaxed, and
469      * all successfully redone operations are placed in the undo history.)
470      * Listeners will receive the <code>REDONE</code> notification.
471      * </p>
472      * <p>
473      * Other severity codes (<code>CANCEL</code>, <code>ERROR</code>,
474      * <code>INFO</code>, etc.) are not specifically interpreted by the
475      * history. The operation will remain in the history and the returned status
476      * is simply passed back to the caller. For all severities other than
477      * <code>OK</code>, listeners will receive the
478      * <code>OPERATION_NOT_OK</code> notification instead of the
479      * <code>REDONE</code> notification if the redo was approved and
480      * attempted.
481      * </p>
482      *
483      * @throws ExecutionException
484      * if an exception occurred during redo.
485      *
486      */

487     IStatus redo(IUndoContext context, IProgressMonitor monitor, IAdaptable info)
488             throws ExecutionException;
489
490     /**
491      * <p>
492      * Redo the specified operation. The redo of the operation is subject to
493      * approval by any registered {@link IOperationApprover} before it is
494      * attempted.
495      * </p>
496      *
497      * @param operation
498      * the operation to be redone
499      * @param monitor
500      * the progress monitor to be used for the redo, or code>null</code>
501      * if no progress monitor is provided
502      * @param info
503      * the IAdaptable (or <code>null</code>) provided by the
504      * caller in order to supply UI information for prompting the
505      * user if necessary. When this parameter is not <code>null</code>,
506      * it should minimally contain an adapter for the
507      * org.eclipse.swt.widgets.Shell.class.
508      *
509      * @return the IStatus indicating whether the redo succeeded.
510      *
511      * <p>
512      * The severity code in the returned status describes whether the operation
513      * succeeded and whether it remains in the history. <code>OK</code>
514      * severity indicates that the redo operation was successful, and (since
515      * release 3.2), that the operation will be placed in the undo history.
516      * (Prior to 3.2, a successfully redone operation would not be placed on the
517      * undo history if it could not be undone. Since 3.2, this is relaxed, and
518      * all successfully redone operations are placed in the undo history.)
519      * Listeners will receive the <code>REDONE</code> notification.
520      * </p>
521      * <p>
522      * Other severity codes (<code>CANCEL</code>, <code>ERROR</code>,
523      * <code>INFO</code>, etc.) are not specifically interpreted by the
524      * history. The operation will remain in the history and the returned status
525      * is simply passed back to the caller. For all severities other than <code>OK</code>,
526      * listeners will receive the <code>OPERATION_NOT_OK</code> notification
527      * instead of the <code>REDONE</code> notification if the redo was
528      * approved and attempted.
529      * </p>
530      *
531      * @throws ExecutionException
532      * if an exception occurred during redo.
533      */

534     IStatus redoOperation(IUndoableOperation operation,
535             IProgressMonitor monitor, IAdaptable info)
536             throws ExecutionException;
537
538     /**
539      * <p>
540      * Remove the specified operation approver from the list of operation
541      * approvers that are consulted before an operation is undone or redone.
542      * </p>
543      *
544      * @param approver
545      * the IOperationApprover to be removed. Must not be
546      * <code>null</code>. If an attempt is made to remove an
547      * instance which is not already registered with this instance,
548      * this method has no effect.
549      */

550     void removeOperationApprover(IOperationApprover approver);
551
552     /**
553      * <p>
554      * Remove the specified listener from the list of operation history
555      * listeners.
556      * </p>
557      *
558      * @param listener
559      * The IOperationHistoryListener to be removed. Must not be
560      * <code>null</code>. If an attempt is made to remove an
561      * instance which is not already registered with this instance,
562      * this method has no effect.
563      */

564     void removeOperationHistoryListener(IOperationHistoryListener listener);
565
566     /**
567      * <p>
568      * Replace the specified operation in the undo or redo history with the
569      * provided list of replacements. This protocol is typically used when a
570      * composite is broken up into its atomic parts. The replacements will be
571      * inserted so that the first replacement will be the first of the
572      * replacements to be undone or redone. Listeners will be notified about the
573      * removal of the replaced element and the addition of each replacement.
574      * </p>
575      *
576      * @param operation
577      * The IUndoableOperation to be replaced
578      * @param replacements
579      * the array of IUndoableOperation to replace the first operation
580      */

581     void replaceOperation(IUndoableOperation operation,
582             IUndoableOperation[] replacements);
583
584     /**
585      * <p>
586      * Set the limit on the undo and redo history for a particular context.
587      * </p>
588      *
589      * @param context
590      * the context whose limit is being set.
591      *
592      * @param limit
593      * the maximum number of operations that should be kept in the
594      * undo or redo history for the specified context. Must not be
595      * negative.
596      */

597     void setLimit(IUndoContext context, int limit);
598
599     /**
600      * <p>
601      * Undo the most recently executed operation in the given context. The undo
602      * of the operation is subject to approval by any registered
603      * {@link IOperationApprover} before it is attempted.
604      * </p>
605      *
606      * @param context
607      * the context to be undone
608      * @param monitor
609      * the progress monitor to be used for the undo, or
610      * <code>null</code> if no progress monitor is provided.
611      * @param info
612      * the IAdaptable (or <code>null</code>) provided by the
613      * caller in order to supply UI information for prompting the
614      * user if necessary. When this parameter is not
615      * <code>null</code>, it should minimally contain an adapter
616      * for the org.eclipse.swt.widgets.Shell.class.
617      *
618      * @return the IStatus indicating whether the undo succeeded.
619      *
620      * <p>
621      * The severity code in the returned status describes whether the operation
622      * succeeded and whether it remains in the history. <code>OK</code>
623      * severity indicates that the undo operation was successful, and (since
624      * release 3.2), that the operation will be placed on the redo history.
625      * (Prior to 3.2, a successfully undone operation would not be placed on the
626      * redo history if it could not be redone. Since 3.2, this is relaxed, and
627      * all successfully undone operations are placed in the redo history.)
628      * Listeners will receive the <code>UNDONE</code> notification.
629      * </p>
630      * <p>
631      * Other severity codes (<code>CANCEL</code>, <code>ERROR</code>,
632      * <code>INFO</code>, etc.) are not specifically interpreted by the
633      * history. The operation will remain in the history and the returned status
634      * is simply passed back to the caller. For all severities other than
635      * <code>OK</code>, listeners will receive the
636      * <code>OPERATION_NOT_OK</code> notification instead of the
637      * <code>UNDONE</code> notification if the undo was approved and
638      * attempted.
639      * </p>
640      *
641      * @throws ExecutionException
642      * if an exception occurred during undo.
643      */

644
645     IStatus undo(IUndoContext context, IProgressMonitor monitor, IAdaptable info)
646             throws ExecutionException;
647
648     /**
649      * <p>
650      * Undo the specified operation. The undo of the operation is subject to
651      * approval by any registered {@link IOperationApprover} before it is
652      * attempted.
653      * </p>
654      *
655      * @param operation
656      * the operation to be undone
657      * @param monitor
658      * the progress monitor to be used for the undo, or
659      * <code>null</code> if no progress monitor is provided
660      * @param info
661      * the IAdaptable (or <code>null</code>) provided by the
662      * caller in order to supply UI information for prompting the
663      * user if necessary. When this parameter is not
664      * <code>null</code>, it should minimally contain an adapter
665      * for the org.eclipse.swt.widgets.Shell.class.
666      *
667      * @return the IStatus indicating whether the undo succeeded.
668      *
669      * <p>
670      * The severity code in the returned status describes whether the operation
671      * succeeded and whether it remains in the history. <code>OK</code>
672      * severity indicates that the undo operation was successful, and (since
673      * release 3.2), that the operation will be placed on the redo history.
674      * (Prior to 3.2, a successfully undone operation would not be placed on the
675      * redo history if it could not be redone. Since 3.2, this is relaxed, and
676      * all successfully undone operations are placed in the redo history.)
677      * Listeners will receive the <code>UNDONE</code> notification.
678      * </p>
679      * <p>
680      * Other severity codes (<code>CANCEL</code>, <code>ERROR</code>,
681      * <code>INFO</code>, etc.) are not specifically interpreted by the
682      * history. The operation will remain in the history and the returned status
683      * is simply passed back to the caller. For all severities other than
684      * <code>OK</code>, listeners will receive the
685      * <code>OPERATION_NOT_OK</code> notification instead of the
686      * <code>UNDONE</code> notification if the undo was approved and
687      * attempted.
688      * </p>
689      *
690      * @throws ExecutionException
691      * if an exception occurred during undo.
692      */

693     IStatus undoOperation(IUndoableOperation operation,
694             IProgressMonitor monitor, IAdaptable info)
695             throws ExecutionException;
696
697 }
698
Popular Tags