Examples of IOperationHistory


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

          return shell;
        return null;
      }
    };

    IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
    try {
      operationHistory.execute(operation, null, context);
    } catch (ExecutionException e) {
      Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
      ILog log= Platform.getLog(bundle);
      String msg= getString(fBundle, fPrefix + "error.dialog.message", fPrefix + "error.dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$
      log.log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, msg, e));
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;
   
    super.dispose();
View Full Code Here

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

      PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION);
      redoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.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

        return null;
      }
    };

    IUndoableOperation operation= new CreateMarkersOperation(fMarkerType, attributes, resource, name);
    IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
    try {
      operationHistory.execute(operation, null, context);
    } catch (ExecutionException x) {
      Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
      ILog log= Platform.getLog(bundle);
      String msg= getString(fBundle, fPrefix + "error.dialog.message", fPrefix + "error.dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$
      log.log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, msg, x));
View Full Code Here

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

    editLayer.repaint();
  }
  
  private void executeAbstractOperation(IUndoableOperation operation) {
    IWorkbench workbench = getSite().getWorkbenchWindow().getWorkbench();
    IOperationHistory operationHistory = workbench.getOperationSupport().getOperationHistory();
   
    //System.out.println("Action executed under context: " + undoContext.getLabel());
   
    IUndoContext undoContext = getUndoContext(); // workbench.getOperationSupport().getUndoContext();
    operation.addContext(undoContext);
    try {
      operationHistory.execute(operation, null, null);
    } catch (ExecutionException e1) {
      e1.printStackTrace();
    }
  }
View Full Code Here

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

        String joinEntityName = _joinEntityNameText.getText();
        boolean flatten = _flattenButton.getSelection();

        NewManyToManyRelationshipOperation operation = new NewManyToManyRelationshipOperation(_sourceEntity, _destinationEntity, createRelationship, name, createInverseRelationship, inverseName, joinEntityName, flatten);
        operation.addContext(EOModelUtils.getUndoContext(_sourceEntity));
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        operationHistory.execute(operation, null, null);
        // _sourceEntity.joinInManyToManyWith(_destinationEntity,
        // createRelationship, name, createInverseRelationship,
        // inverseName, joinEntityName, flatten);
      } else {
        String fkName = null;
        String fkColumnName = null;
        boolean toMany = _toManyButton.getSelection();
        String inverseFKName = null;
        String inverseFKColumnName = null;
        boolean inverseToMany = _inverseToManyButton.getSelection();

        if (_createFK) {
          fkName = _fkNameText.getText();
          fkColumnName = _fkColumnNameText.getText();
        }
        if (_createInverseFK) {
          inverseFKName = _inverseFKNameText.getText();
          inverseFKColumnName = _inverseFKColumnNameText.getText();
        }

        NewOneToManyRelationshipOperation operation = new NewOneToManyRelationshipOperation(_relationship, _sourceEntity, name, createRelationship, toMany, _createFK, fkName, fkColumnName, _destinationEntity, inverseName, createInverseRelationship, inverseToMany, _createInverseFK, inverseFKName, inverseFKColumnName);
        operation.addContext(EOModelUtils.getUndoContext(_sourceEntity));
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        operationHistory.execute(operation, null, null);
      }
      super.okPressed();
    } catch (Throwable t) {
      ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), t);
    }
View Full Code Here

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

        if (!referenceFailures.isEmpty()) {
          new EOModelErrorDialog(getWindow().getShell(), referenceFailures).open();
        } else {
          CutOperation operation = new CutOperation(selectedObjects);
          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

            InheritanceType inheritanceType = dialog.getInheritanceType();
            String restrictingQualifier = dialog.getRestrictingQualifier();
            EOModel destinationModel = dialog.getDestinationModel();
            SubclassOperation operation = new SubclassOperation(parentEntity, inheritanceType, destinationModel, entityName, restrictingQualifier);
            operation.addContext(EOModelUtils.getUndoContext(model));
            IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
            operationHistory.execute(operation, null, null);
          } catch (Throwable e) {
            ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), e);
          }
        } else {
          MessageDialog.openError(getWindow().getShell(), Messages.getString("Subclass.noEntityNameTitle"), Messages.getString("Subclass.noEntityNameMessage"));//$NON-NLS-1$
View Full Code Here

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

      }

      if (attributePath != null) {
        FlattenOperation operation = new FlattenOperation(attributePath);
        operation.addContext(EOModelUtils.getUndoContext(attributePath));
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        operationHistory.execute(operation, null, null);
      } else {
        MessageDialog.openError(getWindow().getShell(), Messages.getString("EORelationship.noRelationshipOrAttributeSelectedTitle"), Messages.getString("EORelationship.noRelationshipOrAttributeSelectedMessage"));//$NON-NLS-1$
      }
    } catch (Throwable e) {
      ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), e);
View Full Code Here

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

        }
      }
      if (selectedObject != null) {
        NewOperation operation = new NewOperation(selectedObject);
        operation.addContext(EOModelUtils.getUndoContext(selectedObject));
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        operationHistory.execute(operation, null, null);
      } else {
        MessageDialog.openError(getWindow().getShell(), getNoSelectionTitle(), getNoSelectionMessage());
      }
    } catch (Throwable e) {
      ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), e);
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.