Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Package


      parentProfile = Activator.getSysMLProfile();
    } else if (profileQualifiedName.startsWith("Standard")) {
      parentProfile = Activator.getStandardProfile();
    }

    Package profilePackage = parentProfile;

    final String[] profiles = profileQualifiedName.split(":{2}");
    // search the profile in the package hierarchy
    for (int index = 1; index < profiles.length - 1; index++) {
      profilePackage = profilePackage.getNestedPackage(profiles[index]);
    }

    Profile profile = (Profile)profilePackage;

    if (profileQualifiedName.startsWith("SysML")) {
      profile = (Profile)profilePackage.getNestedPackage(profiles[profiles.length - 1]);
    }

    if (profile == null) {
      final String message = "Can't apply the profile " + profileQualifiedName + " on "
          + p.getQualifiedName();
View Full Code Here


  }
 
  public static void initializeCollectionsOfContextClasses(StateMachine in_oStateMachine)
  {
    // find all classes in this package hierarchy
    Package oPackage = SystemModelHelper.getSuperPackage(in_oStateMachine);
   
    // remove all existing mappings
    sm_colStateMachineContextClasses.clear();
   
    // get all classes in this package
View Full Code Here

   */
  public IElementHandling findHandler(EditPart p) {
    Class classSel = null;
    Property propSel = null;
    Operation opSel = null;
    Package packSel = null;
    String name = new String();
    // We get the underlying UML element in its specialized form
    if(p.getModel() instanceof Node) {
      Node model = (Node)p.getModel();
      if(
View Full Code Here

        nestingClassName =
          ((NamedElement)container).getName() +'$'
          + nestingClassName;
        container = container.eContainer();
      }
      Package pack = tp.getPackage();
      if((pack==null)&&(container instanceof Package)) {
        pack = (Package)container;
      }
      while(pack!=null) {
        if(
            (pack instanceof Model)
            &&(pack.getName() != null)
            &&(pack.getName().length() > 0)
            &&(
                !pack.getName().equals(
                    IModelService.defaultPackageFileName
                )
            )
        ) {
          name = pack.getName() + '.' + name;
          pack = null;
        }
        else if(
            (pack instanceof Package)
            &&(pack.getName() != null)
            &&(pack.getName().length() > 0)
            &&(
                !pack.getName().equals(
                    IModelService.defaultPackageFileName
                )
            )
        ) {
          name = pack.getName() + '.' + name;
          pack = pack.getNestingPackage();
        }
        else {
          pack = pack.getNestingPackage();
        }
      }
      name += nestingClassName + tp.getName();
    }
    return name;
View Full Code Here

   * UML Package to build the name from
   * @return UML Package fully qualified name
   */
  public static String buildFullyQualifiedName(Package resolvPack) {
    String name = new String();
    Package pack = resolvPack.getNestingPackage();
    while (pack != null) {
      if (
          (pack instanceof Model)
          &&(pack.getName()!=null)
          &&(pack.getName().length() > 0)
          &&(
              !pack.getName().equals(
                  IModelService.defaultPackageFileName
              )
          )
      ) {
        name = pack.getName() + '.' + name;
        pack = null;
      } else if(
          (pack.getName()!=null)
          &&(pack.getName().length() > 0)
          &&(
              !pack.getName().equals(
                  IModelService.defaultPackageFileName
              )
          )
      ) {
        name = pack.getName() + '.' + name;
        pack = pack.getNestingPackage();
      }
      else {
        pack = pack.getNestingPackage();
      }
    }
    name += resolvPack.getName();
    return name;
  }
View Full Code Here

  public void setUpUMLModelElement() {
    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,
      if (
          (parentElement != null)
          && (parent instanceof IPackageService)
          && (umlModelElement == null)
      ) {
        // Then we create a nested package
        umlModelElement =
          parentElement.createNestedPackage(getSimpleName());
      } else if (
          (parent instanceof IModelService)
          &&(parentElement!=null)
      ) {
        /*
         * Else, if the parent is the model,
         * If we have the primitive types package or the class path
         */
        if(
            (getSimpleName().equals("Primitive types"))
            ||(getSimpleName().equals("classpath"))
        ) {
          // Then we create a dedicated package
          umlModelElement =
            parentElement.createNestedPackage(getSimpleName());
          umlModelElement.setVisibility(
              VisibilityKind.PRIVATE_LITERAL
          );
        }
        else {
View Full Code Here

    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);
    pckH  = runnable.getResult();
View Full Code Here

            &&(general.getUMLElement() instanceof Classifier)
        ) {
          Classifier elGeneral = (Classifier)general.getUMLElement();
          Element cont = getContainerService().getUMLElement();
          if(cont instanceof Package) {
            Package pack = (Package)cont;
            Element pEl =
              pack.createPackagedElement(
                  null,
                  UMLPackage.eINSTANCE.getRealization()
              );
            if(pEl instanceof Realization) {
              Realization real = (Realization)pEl;
View Full Code Here

    Element root = (Element)modelResource.getContents().get(0);

    if(root instanceof Package) {

      // Import model library
      Package libToImport = (Package)(modelResource.getContents().get(0));
      // create import package
      PackageImport modelLibImport = UMLFactory.eINSTANCE.createPackageImport();
      modelLibImport.setImportedPackage(libToImport);

      return currentModel.getPackageImports().add(modelLibImport);
View Full Code Here

    Element root = (Element)modelResource.getContents().get(0);

    if(root instanceof Package) {

      // Import model library
      Package libToImport = (Package)(modelResource.getContents().get(0));
      // create import package
      PackageImport modelLibImport = UMLFactory.eINSTANCE.createPackageImport();
      modelLibImport.setImportedPackage(libToImport);

      return modelLibImport;
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.Package

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.