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

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


    }
    return _modelGroup;
  }

  public String[] getEntityNames() {
    EOModelGroup modelGroup = getModelGroup();
    Set<String> entityNames = modelGroup.getNonPrototypeEntityNames();
    return entityNames.toArray(new String[entityNames.size()]);
  }
View Full Code Here


        children = new Object[] { "No Model Loaded" };
      } else {
        children = new Object[] { model };
      }
    } else if (_parentElement instanceof EOModelGroup) {
      EOModelGroup modelGroup = (EOModelGroup) _parentElement;
      Set<EOModel> modelGroupChildren = new TreeSet<EOModel>(new EOSortableEOModelObjectComparator());
      modelGroupChildren.addAll(modelGroup.getModels());
      children = modelGroupChildren.toArray();
    } else if (_parentElement instanceof EOModel) {
      EOModel model = (EOModel) _parentElement;
      Set<EOModelObject> modelChildren = new TreeSet<EOModelObject>(new EOSortableEOModelObjectComparator());
      if (_showEntities) {
View Full Code Here

        indexURL = new File(URLUtils.cheatAndTurnIntoFile(indexURL).getParentFile(), "index.eomodeld").toURI();
      } else if ("fspec".equalsIgnoreCase(extension)) {
        indexURL = new File(URLUtils.cheatAndTurnIntoFile(indexURL).getParentFile(), "index.eomodeld").toURI();
      }

      EOModelGroup modelGroup = new EOModelGroup();
      modelGroup.addPropertyChangeListener(EOModelGroup.MODELS, getContentOutlinePage());
      try {
        IEOModelGroupFactory.Utility.loadModelGroup(indexURL, modelGroup, myLoadFailures, true, indexURL.toURL(), progressMonitor);
      } finally {
        modelGroup.removePropertyChangeListener(EOModelGroup.MODELS, getContentOutlinePage());
      }

      EOModel model = modelGroup.getEditingModel();
      boolean showModelGroup = true;
      if (model == null) {
        handleModelErrors(myLoadFailures, true, null);
        Set<EOModel> models = modelGroup.getModels();
        if (models.size() > 0) {
          model = models.iterator().next();
          showModelGroup = true;
        }
      }
View Full Code Here

  public EOModelGroupCache() {
    _modelGroupCache = new HashMap<IProject, EOModelGroup>();
  }

  public synchronized EOModelGroup getModelGroup(IProject project) {
    EOModelGroup modelGroup;
    if (project == null) {
      modelGroup = new EOModelGroup();
    }
    else {
      modelGroup = _modelGroupCache.get(project);
      if (modelGroup == null) {
        modelGroup = new EOModelGroup();

        Set<EOModelVerificationFailure> failures = new HashSet<EOModelVerificationFailure>();
        try {
          IEOModelGroupFactory.Utility.loadModelGroup(project, modelGroup, failures, true, null, new NullProgressMonitor());
          _modelGroupCache.put(project, modelGroup);
View Full Code Here

import org.objectstyle.wolips.eomodeler.core.model.EOModelGroup;
import org.objectstyle.wolips.eomodeler.core.model.EORelationship;

public class EOModelListContentProvider implements IStructuredContentProvider {
  public Object[] getElements(Object _inputElement) {
    EOModelGroup modelGroup;
    if (_inputElement instanceof EORelationship) {
      modelGroup = ((EORelationship) _inputElement).getEntity().getModel().getModelGroup();
    } else if (_inputElement instanceof EOEntity) {
      modelGroup = ((EOEntity) _inputElement).getModel().getModelGroup();
    } else if (_inputElement instanceof EOModel) {
      modelGroup = ((EOModel) _inputElement).getModelGroup();
    } else if (_inputElement instanceof EOModelGroup) {
      modelGroup = (EOModelGroup) _inputElement;
    } else {
      throw new IllegalArgumentException("Unknown input element: " + _inputElement);
    }
    Set modelsList = modelGroup.getSortedModels();
    EOModel[] models = (EOModel[]) modelsList.toArray(new EOModel[modelsList.size()]);
    return models;
  }
View Full Code Here

TOP

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

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.