1 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 69 public interface IOperationHistory { 70 71 74 public static final int EXECUTE = 1; 75 76 79 public static final int UNDO = 2; 80 81 84 public static final int REDO = 3; 85 86 92 public static final IUndoContext GLOBAL_UNDO_CONTEXT = new GlobalUndoContext(); 93 94 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); 102 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); 110 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); 119 130 void add(IUndoableOperation operation); 131 132 146 void addOperationApprover(IOperationApprover approver); 147 148 164 void addOperationHistoryListener(IOperationHistoryListener listener); 165 166 202 void closeOperation(boolean operationOK, boolean addToHistory, int mode); 203 204 215 216 boolean canRedo(IUndoContext context); 217 218 229 boolean canUndo(IUndoContext context); 230 231 252 void dispose(IUndoContext context, boolean flushUndo, boolean flushRedo, 253 boolean flushContext); 254 255 312 IStatus execute(IUndoableOperation operation, IProgressMonitor monitor, 313 IAdaptable info) throws ExecutionException; 314 315 325 int getLimit(IUndoContext context); 326 327 341 IUndoableOperation[] getRedoHistory(IUndoContext context); 342 343 354 IUndoableOperation getRedoOperation(IUndoContext context); 355 356 369 IUndoableOperation[] getUndoHistory(IUndoContext context); 370 371 415 void openOperation(ICompositeOperation operation, int mode); 416 417 427 void operationChanged(IUndoableOperation operation); 428 429 440 IUndoableOperation getUndoOperation(IUndoContext context); 441 442 487 IStatus redo(IUndoContext context, IProgressMonitor monitor, IAdaptable info) 488 throws ExecutionException; 489 490 534 IStatus redoOperation(IUndoableOperation operation, 535 IProgressMonitor monitor, IAdaptable info) 536 throws ExecutionException; 537 538 550 void removeOperationApprover(IOperationApprover approver); 551 552 564 void removeOperationHistoryListener(IOperationHistoryListener listener); 565 566 581 void replaceOperation(IUndoableOperation operation, 582 IUndoableOperation[] replacements); 583 584 597 void setLimit(IUndoContext context, int limit); 598 599 644 645 IStatus undo(IUndoContext context, IProgressMonitor monitor, IAdaptable info) 646 throws ExecutionException; 647 648 693 IStatus undoOperation(IUndoableOperation operation, 694 IProgressMonitor monitor, IAdaptable info) 695 throws ExecutionException; 696 697 } 698 | Popular Tags |