Package org.objectstyle.wolips.eomodeler.core.model

Examples of org.objectstyle.wolips.eomodeler.core.model.EODatabaseConfig


      EOModelErrorDialog errors = new EOModelErrorDialog(Display.getDefault().getActiveShell(), failures);
      errors.open();
    }

    EOModel model = new EOModel(_modelName);
    EODatabaseConfig databaseConfig = new EODatabaseConfig("Default");
    databaseConfig.setAdaptorName(_adaptorName);
    model.addDatabaseConfig(databaseConfig);
    modelGroup.addModel(model);
    modelGroup.setEditingModelName(_modelName);

    ProjectFrameworkAdapter frameworkAdapter = (ProjectFrameworkAdapter)_parentResource.getProject().getAdapter(ProjectFrameworkAdapter.class);
    // add adaptor framework
    if (!"None".equals(_adaptorName) && !"".equals(_adaptorName)) {
      frameworkAdapter.addFrameworks(frameworkAdapter.getAdaptorFrameworks().get(_adaptorName));
    }
    if (!"None".equals(_pluginName) && !"".equals(_pluginName)) {
      IEclipseFramework pluginFramework = frameworkAdapter.getPluginFrameworks().get(_pluginName);
      frameworkAdapter.addFrameworks(pluginFramework);
      String selectedPrototypeEntityName = "EO" + _adaptorName + _pluginName + "Prototypes";
      EOEntity selectedPrototypeEntity = modelGroup.getEntityNamed(selectedPrototypeEntityName);
      if (selectedPrototypeEntity != null) {
        EODatabaseConfig activeConfig = model.getActiveDatabaseConfig();
        if (activeConfig != null) {
          activeConfig.setPrototype(selectedPrototypeEntity);
        }
      }
    }

    File modelFolderFile = model.saveToFolder(parentContainer.getLocation().toFile());
View Full Code Here


        try {
          EOModel model = new EOModel(modelName);
          modelGroup.addModel(model);
          //model.setEditing(true);
          EODatabaseConfig databaseConfig = new EODatabaseConfig("Default");
          databaseConfig.setAdaptorName("JDBC");
          model.setModelURL(modelFolder.toURI().toURL());
          model.addDatabaseConfig(databaseConfig);
          model.saveToFolder(modelFolder);

          ApplicationWorkbenchAdvisor.openModelPath(modelFolder.getAbsolutePath());
View Full Code Here

      text = argument.getName();
    } else if (_element instanceof EOStoredProcedure) {
      EOStoredProcedure storedProcedure = (EOStoredProcedure) _element;
      text = storedProcedure.getName();
    } else if (_element instanceof EODatabaseConfig) {
      EODatabaseConfig databaseConfig = (EODatabaseConfig) _element;
      text = databaseConfig.getName();
    } else if (_element instanceof EOEntityIndex) {
      EOEntityIndex entityIndex = (EOEntityIndex) _element;
      text = entityIndex.getName();
    } else {
      text = null;
View Full Code Here

      EOEntity entity = (EOEntity) element;
      if (BooleanUtils.isTrue(entity.isAbstractEntity())) {
        font = getInheritedFont();
      }
    } else if (element instanceof EODatabaseConfig) {
      EODatabaseConfig databaseConfig = (EODatabaseConfig) element;
      if (databaseConfig.isActive()) {
        font = getActiveFont();
      }
    } else {
      IEOAttribute attribute = null;
      if (element instanceof IEOAttribute) {
View Full Code Here

    }
    if (_adaptorNameBinding != null) {
      // _adaptorNameComboViewer.getCombo().removeModifyListener(_adaptorNameBinding);
      _adaptorNameBinding.dispose();
    }
    EODatabaseConfig databaseConfig = getDatabaseConfig();
    if (databaseConfig != null) {
      EOModel model = databaseConfig.getModel();
      if (model != null) {
        model.removePropertyChangeListener(EOModel.ACTIVE_DATABASE_CONFIG, _activeDatabaseConfigHandler);
      }
      databaseConfig.removePropertyChangeListener(EODatabaseConfig.ADAPTOR_NAME, _adaptorNameHandler);
    }
  }
View Full Code Here

    _prototypeBinding = new ComboViewerBinding(_prototypeComboViewer, getDatabaseConfig(), EODatabaseConfig.PROTOTYPE, null, null, EOPrototypeEntityListContentProvider.BLANK_ENTITY);
    _adaptorNameComboViewer.setInput(getDatabaseConfig());
    _adaptorNameBinding = new ComboViewerBinding(_adaptorNameComboViewer, getDatabaseConfig(), EODatabaseConfig.ADAPTOR_NAME, null, null, null);
    // _adaptorNameComboViewer.getCombo().addModifyListener(_adaptorNameBinding);

    EODatabaseConfig databaseConfig = getDatabaseConfig();
    if (databaseConfig != null) {
      EOModel model = databaseConfig.getModel();
      if (model != null) {
        model.addPropertyChangeListener(EOModel.ACTIVE_DATABASE_CONFIG, _activeDatabaseConfigHandler);
      }
      databaseConfig.addPropertyChangeListener(EODatabaseConfig.ADAPTOR_NAME, _adaptorNameHandler);
    }
    activeDatabaseConfigChanged();
  }
View Full Code Here

    }
    activeDatabaseConfigChanged();
  }

  protected void makeActive() {
    EODatabaseConfig databaseConfig = getDatabaseConfig();
    if (databaseConfig != null) {
      databaseConfig.setActive();
    }
  }
View Full Code Here

      databaseConfig.setActive();
    }
  }

  protected void activeDatabaseConfigChanged() {
    EODatabaseConfig databaseConfig = getDatabaseConfig();
    if (databaseConfig != null) {
      _makeActiveButton.setEnabled(!databaseConfig.isActive());
    }
  }
View Full Code Here

      // extraInfoData.horizontalSpan = 2;
      _databaseConfigComboViewer.setContentProvider(new DatabaseConfigContentProvider());
      _databaseConfigComboViewer.setLabelProvider(new DatabaseConfigLabelProvider());
      _databaseConfigComboViewer.setInput(_databaseConfigs);
      _databaseConfigComboViewer.getCombo().setLayoutData(extraInfoData);
      EODatabaseConfig activeDatabaseConfig = _model.getActiveDatabaseConfig();
      if (activeDatabaseConfig != null) {
        _databaseConfigComboViewer.setSelection(new StructuredSelection(activeDatabaseConfig));
      } else {
        _databaseConfigComboViewer.setSelection(new StructuredSelection(_databaseConfigs.iterator().next()));
      }
View Full Code Here

  protected Text getMigrationText() {
    return _migrationText;
  }

  protected EODatabaseConfig getSelectedDatabaseConfig() {
    EODatabaseConfig selectedDatabaseConfig = null;
    if (_databaseConfigComboViewer != null) {
      IStructuredSelection selection = (IStructuredSelection) _databaseConfigComboViewer.getSelection();
      selectedDatabaseConfig = (EODatabaseConfig) selection.getFirstElement();
    } else {
      selectedDatabaseConfig = _model.getActiveDatabaseConfig();
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.eomodeler.core.model.EODatabaseConfig

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.