private void historyNotification(OperationHistoryEvent event) { switch (event.getEventType()) { case OperationHistoryEvent.OPERATION_ADDED: if (copyOperationInProgress) { copyUndoable = event.getOperation(); } break; case OperationHistoryEvent.UNDONE: if (copyUndoable == event.getOperation()) { update(false); } break; default: // Nothing to do break; } }
private void notifyDone(IUndoableOperation operation) { if (DEBUG_OPERATION_HISTORY_NOTIFICATION) { Tracing.printTrace("OPERATIONHISTORY", "DONE " + operation); //$NON-NLS-1$ //$NON-NLS-2$ } notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.DONE, this, operation)); }
private void notifyListeners(final OperationHistoryEvent event) { if (event.getOperation() instanceof IAdvancedUndoableOperation) { final IAdvancedUndoableOperation advancedOp = (IAdvancedUndoableOperation) event.getOperation(); SafeRunner.run(new ISafeRunnable() { @Override
return; switch (event.getEventType()) { case OperationHistoryEvent.OPERATION_ADDED: case OperationHistoryEvent.OPERATION_REMOVED: case OperationHistoryEvent.UNDONE: case OperationHistoryEvent.REDONE: if (event.getOperation().hasContext(undoContext)) { display.asyncExec(() -> update()); if (event.getOperation().hasContext(undoContext)) { display.asyncExec(() -> { if (pruning) { IStatus status = event.getStatus(); if (event.getOperation() == getOperation()) { display.asyncExec(() -> update());
public void aboutToNotify(OperationHistoryEvent event) { switch(event.getEventType()) { case OperationHistoryEvent.ABOUT_TO_EXECUTE: case OperationHistoryEvent.ABOUT_TO_UNDO: case OperationHistoryEvent.ABOUT_TO_REDO: case OperationHistoryEvent.DONE: case OperationHistoryEvent.UNDONE: case OperationHistoryEvent.REDONE: case OperationHistoryEvent.OPERATION_NOT_OK: ResourcesPlugin.getWorkspace().checkpoint(false); break; } }
private void notifyListeners(final OperationHistoryEvent event) { if (event.getOperation() instanceof IAdvancedUndoableOperation) { final IAdvancedUndoableOperation advancedOp = (IAdvancedUndoableOperation) event.getOperation(); SafeRunner.run(new ISafeRunnable() { @Override
public void historyNotification(OperationHistoryEvent event) { final int type = event.getEventType(); switch (type) { case OperationHistoryEvent.UNDONE: case OperationHistoryEvent.REDONE: case OperationHistoryEvent.OPERATION_ADDED: case OperationHistoryEvent.OPERATION_REMOVED: case OperationHistoryEvent.OPERATION_NOT_OK: // if this is one of our operations if (event.getOperation().hasContext(this.context)) { this.update.update(); } } } }
private void notifyListeners(final OperationHistoryEvent event) { if (event.getOperation() instanceof IAdvancedUndoableOperation) { final IAdvancedUndoableOperation advancedOp = (IAdvancedUndoableOperation) event.getOperation(); SafeRunner.run(new ISafeRunnable() { @Override
private void notifyNotOK(IUndoableOperation operation, IStatus status) { if (DEBUG_OPERATION_HISTORY_NOTIFICATION) { Tracing.printTrace("OPERATIONHISTORY", "OPERATION_NOT_OK " + operation); //$NON-NLS-1$ //$NON-NLS-2$ } notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.OPERATION_NOT_OK, this, operation, status)); }
@Override public void historyNotification(final OperationHistoryEvent event) { final int type= event.getEventType(); switch (type) { case OperationHistoryEvent.ABOUT_TO_UNDO: case OperationHistoryEvent.ABOUT_TO_REDO: if (event.getOperation().hasContext(fUndoContext)) { if (event.getOperation() instanceof UndoableTextChange) { listenToTextChanges(false); fLastAddedTextEdit= null; fOperation= event.getOperation(); case OperationHistoryEvent.REDONE: case OperationHistoryEvent.OPERATION_NOT_OK: if (event.getOperation() == fOperation) { listenToTextChanges(true); fOperation= null;
public void historyNotification(OperationHistoryEvent event) { // This method updates the enablement of all content operations // when the undo history changes. It could be localized to UNDO and REDO. IUndoContext context = getUndoContext(); if (context != null && event.getOperation().hasContext(context)) { Display.getDefault().asyncExec(new Runnable() { public void run() { updateContentDependantActions(); } }); } }
private void notifyRedone(IUndoableOperation operation) { if (DEBUG_OPERATION_HISTORY_NOTIFICATION) { Tracing.printTrace("OPERATIONHISTORY", "REDONE " + operation); //$NON-NLS-1$ //$NON-NLS-2$ } notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.REDONE, this, operation)); }
@Override public void historyNotification(final OperationHistoryEvent event) { final int type= event.getEventType(); switch (type) { case OperationHistoryEvent.ABOUT_TO_UNDO: case OperationHistoryEvent.ABOUT_TO_REDO: if (event.getOperation().hasContext(fUndoContext)) { if (event.getOperation() instanceof UndoableTextChange) { listenToTextChanges(false); fLastAddedTextEdit= null; fOperation= event.getOperation(); case OperationHistoryEvent.REDONE: case OperationHistoryEvent.OPERATION_NOT_OK: if (event.getOperation() == fOperation) { listenToTextChanges(true); fOperation= null;
@Override public void historyNotification(OperationHistoryEvent event) { // This method updates the enablement of all content operations // when the undo history changes. It could be localized to UNDO and REDO. IUndoContext context = getUndoContext(); if (context != null && event.getOperation().hasContext(context)) { Display.getDefault().asyncExec(() -> updateContentDependantActions()); } }
private void notifyAboutToExecute(IUndoableOperation operation) { if (DEBUG_OPERATION_HISTORY_NOTIFICATION) { Tracing.printTrace("OPERATIONHISTORY", "ABOUT_TO_EXECUTE " + operation); //$NON-NLS-1$ //$NON-NLS-2$ } notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.ABOUT_TO_EXECUTE, this, operation)); }
if (!event.getOperation().hasContext( WorkspaceUndoUtil.getWorkspaceUndoContext())) { return; switch (event.getEventType()) { case OperationHistoryEvent.ABOUT_TO_EXECUTE: case OperationHistoryEvent.ABOUT_TO_UNDO: case OperationHistoryEvent.ABOUT_TO_REDO: operationInProgress = event.getOperation(); break; case OperationHistoryEvent.DONE:
@Override public void run() { // if we are undoing/redoing a command we generated, then ignore // the document changes associated with this undo or redo. if (event.getOperation() instanceof TextCommand) { if (fTextViewer instanceof TextViewer) ((TextViewer)fTextViewer).ignoreAutoEditStrategies(true); listenToTextChanges(false); // in the undo case only, make sure compounds are closed if (type == OperationHistoryEvent.ABOUT_TO_UNDO) { if (fFoldingIntoCompoundChange) { endCompoundChange(); } } } else { // the undo or redo has our context, but it is not one of // our commands. We will listen to the changes, but will // reset the state that tracks the undo/redo history. commit(); fLastAddedCommand= null; } } });
private void notifyAboutToRedo(IUndoableOperation operation) { if (DEBUG_OPERATION_HISTORY_NOTIFICATION) { Tracing.printTrace("OPERATIONHISTORY", "ABOUT_TO_REDO " + operation); //$NON-NLS-1$ //$NON-NLS-2$ } notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.ABOUT_TO_REDO, this, operation)); }
@Override public void historyNotification(OperationHistoryEvent event) { IUndoableOperation op= event.getOperation(); if (op instanceof TriggeredOperations) { op= ((TriggeredOperations)op).getTriggeringOperation(); return; Change change= changeOperation.getChange(); switch(event.getEventType()) { case OperationHistoryEvent.ABOUT_TO_EXECUTE: case OperationHistoryEvent.ABOUT_TO_UNDO:
private void notifyRemoved(IUndoableOperation operation) { if (DEBUG_OPERATION_HISTORY_NOTIFICATION) { Tracing.printTrace("OPERATIONHISTORY", "OPERATION_REMOVED " + operation); //$NON-NLS-1$ //$NON-NLS-2$ } notifyListeners(new OperationHistoryEvent(OperationHistoryEvent.OPERATION_REMOVED, this, operation)); }