Examples of IOperationHistory


Examples of org.eclipse.core.commands.operations.IOperationHistory

                DeleteOperation operation = new DeleteOperation(eoModelObject);
                compositeOperation.add(operation);
              }
            }
            compositeOperation.addContext(EOModelUtils.getUndoContext(selectedObjects));
            IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
            operationHistory.execute(compositeOperation, null, null);
          } catch (ExecutionException e) {
            throw new RuntimeException("Failed to delete.", e);
          }
        }
      } catch (Throwable t) {
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

            selectedObjectsList.add(object._cloneModelObject());
          }
        }
        CopyOperation operation = new CopyOperation(selectedObjectsList);
        operation.addContext(EOModelUtils.getUndoContext(selectedObjects));
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        operationHistory.execute(operation, null, null);
      }
    } catch (Throwable t) {
      ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), t);
    }
  }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

            }
          }
        }

        pasteOperation.addContext(EOModelUtils.getUndoContext(selectedObject));
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        operationHistory.execute(pasteOperation, null, null);
      }
    } catch (Throwable t) {
      ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), t);
    }
  }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

    }

    if (fVerticalRuler != null)
      fVerticalRuler= null;

    IOperationHistory history= OperationHistoryFactory.getOperationHistory();
    if (history != null) {
      if (fNonLocalOperationApprover != null)
        history.removeOperationApprover(fNonLocalOperationApprover);
      if (fLinearUndoViolationApprover != null)
        history.removeOperationApprover(fLinearUndoViolationApprover);
    }
    fNonLocalOperationApprover= null;
    fLinearUndoViolationApprover= null;

    if (fKeyBindingSupportForContentAssistant != null) {
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

      PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION);
      redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
      registerUndoRedoAction(ITextEditorActionConstants.REDO, redoAction);

      // Install operation approvers
      IOperationHistory history= OperationHistoryFactory.getOperationHistory();

      // The first approver will prompt when operations affecting outside elements are to be undone or redone.
      if (fNonLocalOperationApprover != null)
        history.removeOperationApprover(fNonLocalOperationApprover);
      fNonLocalOperationApprover= getUndoRedoOperationApprover(undoContext);
      history.addOperationApprover(fNonLocalOperationApprover);

      // The second approver will prompt from this editor when an undo is attempted on an operation
      // and it is not the most recent operation in the editor.
      if (fLinearUndoViolationApprover != null)
        history.removeOperationApprover(fLinearUndoViolationApprover);
      fLinearUndoViolationApprover= new LinearUndoViolationUserApprover(undoContext, this);
      history.addOperationApprover(fLinearUndoViolationApprover);

    } else {
      // Use text operation actions (pre 3.1 style)

      ResourceAction action;
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

            AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER);
    if (fShowLineNumber) {
      updateLineNumberRuler();
    }

    IOperationHistory history = getHistory();
    if (history != null)
      history.addOperationHistoryListener(this);
  }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

    removeTextListener(this);
    removeSelectionChangedListener(this);
    EditorsUI.getPreferenceStore().removePropertyChangeListener(
        fPreferenceChangeListener);

    IOperationHistory history = getHistory();
    if (history != null)
      history.removeOperationHistoryListener(this);

    super.handleDispose();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.