1 11 package org.eclipse.core.commands.operations; 12 13 import org.eclipse.core.runtime.IStatus; 14 15 31 public final class OperationHistoryEvent { 32 33 47 48 public static final int ABOUT_TO_EXECUTE = 1; 49 50 59 public static final int ABOUT_TO_REDO = 2; 60 61 70 public static final int ABOUT_TO_UNDO = 3; 71 72 84 public static final int DONE = 4; 85 86 93 public static final int OPERATION_ADDED = 5; 94 95 101 public static final int OPERATION_CHANGED = 6; 102 103 114 public static final int OPERATION_NOT_OK = 7; 115 116 124 public static final int OPERATION_REMOVED = 8; 125 126 132 public static final int REDONE = 9; 133 134 140 public static final int UNDONE = 10; 141 142 private int code = 0; 143 144 private IOperationHistory history; 145 146 private IUndoableOperation operation; 147 148 149 private IStatus status; 150 151 161 public OperationHistoryEvent(int code, IOperationHistory history, 162 IUndoableOperation operation) { 163 this(code, history, operation, null); 164 } 165 166 181 public OperationHistoryEvent(int code, IOperationHistory history, 182 IUndoableOperation operation, IStatus status) { 183 if (history == null) { 184 throw new NullPointerException (); 185 } 186 if (operation == null) { 187 throw new NullPointerException (); 188 } 189 this.code = code; 190 this.history = history; 191 this.operation = operation; 192 this.status = status; 193 } 194 195 200 public int getEventType() { 201 return code; 202 } 203 204 209 210 public IOperationHistory getHistory() { 211 return history; 212 } 213 214 219 220 public IUndoableOperation getOperation() { 221 return operation; 222 } 223 224 231 232 public IStatus getStatus() { 233 return status; 234 } 235 236 } 237 | Popular Tags |