Package net.sourceforge.coffea.uml2.model

Examples of net.sourceforge.coffea.uml2.model.IModelHandling


        // Then we look for it in the model
        tHandler = getModelService().resolveTypeService(typeName);
      }
      else {
        // Else we got to get the local package
        IPackageService packSrv = null;
        IContainerService contSrv = getContainerService();
        while(
            (contSrv != null)
            &&(!(contSrv instanceof IPackageService))
            &&(contSrv instanceof IContainableElementService<?, ?>)
        ) {

          contSrv =
            ((IContainableElementService<?, ?>)contSrv)
            .getContainerService();
        }
        // From the package we can have the type
        if(contSrv instanceof IPackageService) {
          packSrv = (IPackageService)contSrv;
          String packName = packSrv.getFullName();
          String fullName = packName + '.' + typeName;
          tHandler = packSrv.resolveTypeService(fullName);
        }
      }
    }
    return tHandler;
  }
View Full Code Here


    List<IPackageService> children = new ArrayList<IPackageService>();
    IModelService m = getModelService();
    if (m != null) {
      List<IPackageService> allPackages = m.getPackagesServices();
      if (allPackages != null) {
        IPackageService p = null;
        for (int i = 0; i < allPackages.size(); i++) {
          p = allPackages.get(i);
          if (p != null) {
            if ((p.getContainerService().equals(this))) {
              p.fetchSubPackagesFromHierarchy();
              children.add(p);
              addPackageService(p);
            }
          }
        }
View Full Code Here

    if (umlModelElement == null) {
      IModelService md = null;
      IGroupService parent = getContainerService();
      Package parentElement = null;
      if (parent instanceof IPackageService) {
        IPackageService pk = (IPackageService) parent;
        parentElement = pk.getUMLElement();
      } else if (parent instanceof IModelService) {
        md = (IModelService) parent;
        parentElement = md.getUMLElement();
      }
      // If the parent element is a package,
View Full Code Here

  public IPackageService resolvePackageService(String n) {
    if (this.getFullName().equals(n)) {
      return this;
    }
    for (int i = 0; i < this.packages.size(); i++) {
      IPackageService child;
      if (
          (child = this.packages.get(i).resolvePackageService(n))
          != null
      ) {
        return child;
View Full Code Here

            }
          }
        }
      }
      if ((ret == null) && (packages != null)) {
        IPackageService p;
        for (int i = 0; i < packages.size(); i++) {
          p = packages.get(i);
          if (p != null) {
            String fName = p.getFullName();
            if (n.equals(fName)) {
              ret = p;
            } else {
              ret = p.getElementService(n);
            }
            if (ret != null) {
              break;
            }
          }
View Full Code Here

          ret.add(t);
        }
      }
    }
    if (packages != null) {
      IPackageService p;
      for (int i = 0; i < packages.size(); i++) {
        p = packages.get(i);
        if (p != null) {
          ret.add(p);
        }
View Full Code Here

    cl  = runnable.getResult();
    return cl;
  }

  public IPackageService createNestedPackage(Package newPackage) {
    IPackageService pckH = null;
    NestedPackageCreation runnable =
      new NestedPackageCreation(newPackage, this);
    /*
      PlatformUI.getWorkbench().getProgressService().run(
          false,
View Full Code Here

    pckH  = runnable.getResult();
    return pckH;
  }
 
  public IPackageService createNestedPackage(String simpleName) {
    IPackageService pckH = null;
    Package newPackage =
      getUMLElement().createNestedPackage(simpleName);
    NestedPackageCreation runnable =
      new NestedPackageCreation(newPackage, this);
    CoffeaUML2Plugin.getInstance().execute(runnable);
View Full Code Here

          qualifiedName = getFullName() + '.' + simpleName;
        }
        else {
          qualifiedName = simpleName;
        }
        IPackageService packH = resolvePackageService(qualifiedName);
        if (packH != null) {
          IPackageFragment jEl = packH.getJavaElement();
          if (jEl != null) {
            try {
              jEl.delete(
                  true,
                  monitor
View Full Code Here

      else if(defaultSimpleName!=null) {
        name = getSimpleName();
      }
      if(name!=null) {
        if(parent instanceof IPackageService) {
          IPackageService pk = (IPackageService)parent;
          umlModelElement =
            pk.getUMLElement().createOwnedClass(
                name,
                isAbstract()
            );
        }
        else if(parent instanceof IClassService<?, ?>) {
          IClassService<?, ?> pk = (IClassService<?, ?>)parent;
          umlModelElement =
            UMLFactory.eINSTANCE.createClass();
          int indDollar = -1;
          if((indDollar = name.indexOf('$'))>=0) {
            name = name.substring(indDollar+1);
          }
          umlModelElement.setName(name);
          pk.getUMLElement().getNestedClassifiers().add(
              umlModelElement
          );
        }
        else if(parent instanceof IModelService) {
          IModelService md = (IModelService)parent;
View Full Code Here

TOP

Related Classes of net.sourceforge.coffea.uml2.model.IModelHandling

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.