@Override public void aboutToPerformChange(Change change) { IUndoableOperation operation= new UndoableOperation2ChangeAdapter(change); operation.addContext(RefactoringCorePlugin.getUndoContext()); fActiveOperation= new TriggeredOperations(operation, fOperationHistory); fActiveOperation.addContext(RefactoringCorePlugin.getUndoContext()); fOperationHistory.openOperation(fActiveOperation, IOperationHistory.EXECUTE); fIsOpen= true; }
@Override public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.EXECUTE); try { IStatus status = triggeringOperation.execute(monitor, info); history.closeOperation(status.isOK(), false, IOperationHistory.EXECUTE); return status; } catch (ExecutionException e) { history.closeOperation(false, false, IOperationHistory.EXECUTE); throw e; } catch (RuntimeException e) { history.closeOperation(false, false, IOperationHistory.EXECUTE); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
public void aboutToPerformChange(Change change) { IUndoableOperation operation= new UndoableOperation2ChangeAdapter(change); operation.addContext(RefactoringCorePlugin.getUndoContext()); fActiveOperation= new TriggeredOperations(operation, fOperationHistroy); fActiveOperation.addContext(RefactoringCorePlugin.getUndoContext()); fOperationHistroy.openOperation(fActiveOperation, IOperationHistory.EXECUTE); fIsOpen= true; }
@Override public void aboutToPerformChange(Change change) { IUndoableOperation operation= new UndoableOperation2ChangeAdapter(change); operation.addContext(RefactoringCorePlugin.getUndoContext()); fActiveOperation= new TriggeredOperations(operation, fOperationHistory); fActiveOperation.addContext(RefactoringCorePlugin.getUndoContext()); fOperationHistory.openOperation(fActiveOperation, IOperationHistory.EXECUTE); fIsOpen= true; }
@Override public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.EXECUTE); try { IStatus status = triggeringOperation.execute(monitor, info); history.closeOperation(status.isOK(), false, IOperationHistory.EXECUTE); return status; } catch (ExecutionException e) { history.closeOperation(false, false, IOperationHistory.EXECUTE); throw e; } catch (RuntimeException e) { history.closeOperation(false, false, IOperationHistory.EXECUTE); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.EXECUTE); try { IStatus status = triggeringOperation.execute(monitor, info); history.closeOperation(status.isOK(), false, IOperationHistory.EXECUTE); return status; } catch (ExecutionException e) { history.closeOperation(false, false, IOperationHistory.EXECUTE); throw e; } catch (RuntimeException e) { history.closeOperation(false, false, IOperationHistory.EXECUTE); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.UNDO); List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); try { removeAllChildren(); IStatus status = triggeringOperation.undo(monitor, info); if (!status.isOK()) { children = childrenToRestore; } history.closeOperation(status.isOK(), false, IOperationHistory.UNDO); return status; } catch (ExecutionException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.UNDO); throw e; } catch (RuntimeException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.UNDO); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.REDO); List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); try { removeAllChildren(); IStatus status = triggeringOperation.redo(monitor, info); if (!status.isOK()) { children = childrenToRestore; } history.closeOperation(status.isOK(), false, IOperationHistory.REDO); return status; } catch (ExecutionException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.REDO); throw e; } catch (RuntimeException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.REDO); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.UNDO); List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); try { removeAllChildren(); IStatus status = triggeringOperation.undo(monitor, info); if (!status.isOK()) { children = childrenToRestore; } history.closeOperation(status.isOK(), false, IOperationHistory.UNDO); return status; } catch (ExecutionException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.UNDO); throw e; } catch (RuntimeException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.UNDO); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.UNDO); List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); try { removeAllChildren(); IStatus status = triggeringOperation.undo(monitor, info); if (!status.isOK()) { children = childrenToRestore; } history.closeOperation(status.isOK(), false, IOperationHistory.UNDO); return status; } catch (ExecutionException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.UNDO); throw e; } catch (RuntimeException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.UNDO); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.REDO); List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); try { removeAllChildren(); IStatus status = triggeringOperation.redo(monitor, info); if (!status.isOK()) { children = childrenToRestore; } history.closeOperation(status.isOK(), false, IOperationHistory.REDO); return status; } catch (ExecutionException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.REDO); throw e; } catch (RuntimeException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.REDO); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }
@Override public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (triggeringOperation != null) { history.openOperation(this, IOperationHistory.REDO); List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); try { removeAllChildren(); IStatus status = triggeringOperation.redo(monitor, info); if (!status.isOK()) { children = childrenToRestore; } history.closeOperation(status.isOK(), false, IOperationHistory.REDO); return status; } catch (ExecutionException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.REDO); throw e; } catch (RuntimeException e) { children = childrenToRestore; history.closeOperation(false, false, IOperationHistory.REDO); throw e; } } return IOperationHistory.OPERATION_INVALID_STATUS; }