Package org.openbp.core.model

Examples of org.openbp.core.model.ModelImpl


  private void copyModel(Model model)
    throws Exception
  {
    printMsg("Copying model '" + model.getName() + "' from " + sourceMgrType + " model manager to " + targetMgrType + " model manager.");

    Model newModel = new ModelImpl();
    newModel.copyFrom(model, Copyable.COPY_SHALLOW);
    ((ModelImpl) newModel).internalResetItems();
    targetMgr.addModel(newModel);

    copyItems(newModel, model, ItemTypes.TYPE, targetMgr);
    copyItems(newModel, model, ItemTypes.ACTOR, targetMgr);
View Full Code Here


  //////////////////////////////////////////////////

  private Model dbModelToModel(DbModel dbModel)
  {
    ByteArrayInputStream in = new ByteArrayInputStream(dbModel.getXml().getBytes());
    ModelImpl model = (ModelImpl) XMLDriver.getInstance().deserializeStream(ModelImpl.class, in);
    return model;
  }
View Full Code Here

   */
  public boolean validateObject(Object editedObject, PropertyBrowser pb)
  {
    boolean ret = true;

    ModelImpl model = (ModelImpl) editedObject;

    List importList = null;

    List containers = model.getImportPBContainerList();
    if (containers != null)
    {
      int n = containers.size();
      if (n > 0)
      {
        importList = new ArrayList();

        for (int i = 0; i < n; ++i)
        {
          ModelImportPBContainer container = (ModelImportPBContainer) containers.get(i);

          String name = container.getName();
          if (name == null)
          {
            // We ignore empty containers
            continue;
          }

          name = ModelQualifier.normalizeModelName(name);

          // First, check if the model can be resolved
          if (model.getModelMgr().getOptionalModelByQualifier(ModelQualifier.constructModelQualifier(name)) == null)
          {
            displayErrorMsg("Cannot resolve model '" + name + "'.");
            ret = false;
          }

          importList.add(name);
        }
      }
    }

    if (! ret)
      return false;

    model.setImportList(importList);
    model.setImportPBContainerList(null);
    model.setImportContainerListCreated(false);

    return super.validateObject(editedObject, pb);
  }
View Full Code Here

TOP

Related Classes of org.openbp.core.model.ModelImpl

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.