Package org.eclipse.core.commands.operations

Examples of org.eclipse.core.commands.operations.IOperationHistory.execute()


      }
    };

    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


    };

    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

    //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

        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;
View Full Code Here

        }

        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

          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

            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

      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

      }
      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

                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

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.