@Override public boolean canUndo(IUndoContext context) { // null context is allowed and passed through IUndoableOperation operation = getUndoOperation(context); return (operation != null && operation.canUndo()); }
@Override public boolean canRedo(IUndoContext context) { // null context is allowed and passed through IUndoableOperation operation = getRedoOperation(context); return (operation != null && operation.canRedo()); }
@Override public boolean redoable() { return OperationHistoryFactory.getOperationHistory().canRedo(fUndoContext); }
@Override public boolean undoable() { return OperationHistoryFactory.getOperationHistory().canUndo(fUndoContext); }
/** * Disposes the command stack. * * @since 3.1 */ private void disposeCommandStack() { fHistory.dispose(fUndoContext, true, true, true); }
private void internalRemove(IUndoableOperation operation) { operation.dispose(); notifyRemoved(operation); }
@Override public boolean canExecute() { if (triggeringOperation != null) { return triggeringOperation.canExecute(); } return false; }
@Override public Object[] getAffectedObjects() { if (triggeringOperation instanceof IAdvancedUndoableOperation) { return ((IAdvancedUndoableOperation) triggeringOperation).getAffectedObjects(); } return null; }
/** * @since 3.6 */ @Override public boolean runInBackground() { if (triggeringOperation instanceof IAdvancedUndoableOperation2) { return ((IAdvancedUndoableOperation2) triggeringOperation).runInBackground(); } return false; } }
private UndoableOperation2ChangeAdapter getUnwrappedOperation(IUndoableOperation operation) { IUndoableOperation result= operation; if (result instanceof TriggeredOperations) { result= ((TriggeredOperations)result).getTriggeringOperation(); } if (result instanceof UndoableOperation2ChangeAdapter) { return (UndoableOperation2ChangeAdapter)result; } return null; }
/** * The string representation of this operation. Used for debugging purposes only. * This string should not be shown to an end user. * * @return The string representation. */ @Override public String toString() { return getLabel(); }
@Override public void aboutToNotify(OperationHistoryEvent event) { if (triggeringOperation instanceof IAdvancedUndoableOperation) { ((IAdvancedUndoableOperation) triggeringOperation).aboutToNotify(event); } }
@Override public boolean redoable() { return OperationHistoryFactory.getOperationHistory().canRedo(fUndoContext); }
@Override public boolean undoable() { return OperationHistoryFactory.getOperationHistory().canUndo(fUndoContext); }
@Override public boolean canUndo(IUndoContext context) { // null context is allowed and passed through IUndoableOperation operation = getUndoOperation(context); return (operation != null && operation.canUndo()); }
@Override public boolean canRedo(IUndoContext context) { // null context is allowed and passed through IUndoableOperation operation = getRedoOperation(context); return (operation != null && operation.canRedo()); }
private void internalRemove(IUndoableOperation operation) { operation.dispose(); notifyRemoved(operation); }
@Override public boolean canUndo(IUndoContext context) { // null context is allowed and passed through IUndoableOperation operation = getUndoOperation(context); return (operation != null && operation.canUndo()); }
@Override public boolean canRedo(IUndoContext context) { // null context is allowed and passed through IUndoableOperation operation = getRedoOperation(context); return (operation != null && operation.canRedo()); }
private void internalRemove(IUndoableOperation operation) { operation.dispose(); notifyRemoved(operation); }