Package org.objectstyle.wolips.eomodeler.editors

Examples of org.objectstyle.wolips.eomodeler.editors.EOModelErrorDialog


        eogenModel.writeToFile(eogenFile, null);
      }
      if (!failures.isEmpty()) {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            new EOModelErrorDialog(new Shell(), failures).open();
          }
        });
      }
    } catch (final Throwable t) {
      t.printStackTrace();
View Full Code Here


    Set<EOModelVerificationFailure> failures = new HashSet<EOModelVerificationFailure>();
    IContainer parentContainer = (IContainer) _parentResource;
    IFolder existingModelFolder = parentContainer.getFolder(new Path(_modelName + ".eomodeld"));
    if (existingModelFolder.exists()) {
      failures.add(new EOModelVerificationFailure(null, "There's already a model in " + existingModelFolder.getLocation().toOSString() + ".", true, null));
      EOModelErrorDialog errors = new EOModelErrorDialog(Display.getDefault().getActiveShell(), failures);
      errors.open();
      return;
    }

    boolean createModelGroup = false;
    EOModelGroup modelGroup = new EOModelGroup();
    try {
      IEOModelGroupFactory.Utility.loadModelGroup(_parentResource, modelGroup, failures, true, existingModelFolder.getLocation().toFile().toURL(), new NullProgressMonitor());
    } catch (Exception e) {
      failures.clear();
      failures.add(new EOModelVerificationFailure(null, "Creating empty EOModelGroup for this model because " + e.getMessage(), true, e));
      modelGroup = new EOModelGroup();
      createModelGroup = true;
      EOModelErrorDialog errors = new EOModelErrorDialog(Display.getDefault().getActiveShell(), failures);
      errors.open();
    }

    EOModel model = new EOModel(_modelName);
    EODatabaseConfig databaseConfig = new EODatabaseConfig("Default");
    databaseConfig.setAdaptorName(_adaptorName);
View Full Code Here

      Object[] selectedObjects = getSelectedObjects();
      if (selectedObjects != null) {
        Set<EOModelReferenceFailure> referenceFailures = EOModelUtils.getReferenceFailures(selectedObjects);
        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);
View Full Code Here

        Set<EOModelVerificationFailure> failures = new HashSet<EOModelVerificationFailure>();
        //IContainer parentContainer = (IContainer) _parentResource;
        File modelFolder = new File(modelContainerPath, modelName + ".eomodeld");
        if (modelFolder.exists()) {
          failures.add(new EOModelVerificationFailure(null, "There's already a model in " + modelFolder + ".", true, null));
          EOModelErrorDialog errors = new EOModelErrorDialog(Display.getDefault().getActiveShell(), failures);
          errors.open();
          return;
        }

        EOModelGroup modelGroup = new EOModelGroup();
        try {
          IEOModelGroupFactory.Utility.loadModelGroup(modelFolder, modelGroup, failures, true, modelFolder.toURI().toURL(), new NullProgressMonitor());
        }
        catch (Exception e) {
          failures.clear();
          failures.add(new EOModelVerificationFailure(null, "Creating empty EOModelGroup for this model because " + e.getMessage(), true, e));
          modelGroup = new EOModelGroup();
          EOModelErrorDialog errors = new EOModelErrorDialog(Display.getDefault().getActiveShell(), failures);
          errors.open();
        }

        try {
          EOModel model = new EOModel(modelName);
          modelGroup.addModel(model);
View Full Code Here

      model = EOModelUtils.getRelatedModel(selectedObject);
    }
    if (model != null) {
      Set<EOModelVerificationFailure> verifyFailures = new HashSet<EOModelVerificationFailure>();
      model.verify(verifyFailures);
      EOModelErrorDialog dialog = new EOModelErrorDialog(getWindow().getShell(), verifyFailures);
      dialog.open();
    }
  }
View Full Code Here

        Set<EOModelReferenceFailure> referenceFailures = EOModelUtils.getReferenceFailures(selectedObjects);
        boolean delete = false;
        if (referenceFailures.isEmpty()) {
          delete = MessageDialog.openConfirm(activeShell, Messages.getString("delete.objectsTitle"), Messages.getString("delete.objectsMessage"));
        } else {
          int results = new EOModelErrorDialog(activeShell, referenceFailures, true).open();
          if (results == EOModelErrorDialog.DELETE_ANYWAY_ID) {
            delete = MessageDialog.openConfirm(activeShell, Messages.getString("deleteAnyway.objectsTitle"), Messages.getString("deleteAnyway.objectsMessage"));
            if (delete) {
              Set<EOModelObject> recommendedDeletions = EOModelUtils.getRecommendedDeletions(selectedObjects);
              selectedObjects = recommendedDeletions.toArray();

              Set<EOModelReferenceFailure> deleteAnywayReferenceFailures = EOModelUtils.getReferenceFailures(selectedObjects);
              if (!deleteAnywayReferenceFailures.isEmpty()) {
                delete = false;
                new EOModelErrorDialog(activeShell, referenceFailures, false).open();
              }
            }
          }
        }
View Full Code Here

          List<String> selectedTableNamesList = Arrays.asList(selectedTableNames);
          File reverseEngineeredEOModelFolder = reverseEngineer.reverseEngineerWithTableNamesIntoModel(selectedTableNamesList);
          Set<EOModelVerificationFailure> failures = new HashSet<EOModelVerificationFailure>();
          model.importEntitiesFromModel(reverseEngineeredEOModelFolder.toURL(), failures);
          if (failures.size() > 0) {
            EOModelErrorDialog dialog = new EOModelErrorDialog(getWindow().getShell(), failures);
            dialog.open();
          }
          model.setReverseEngineered(true);
        }
      }
    } catch (Throwable e) {
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.eomodeler.editors.EOModelErrorDialog

Copyright © 2018 www.massapicom. 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.