Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Element


      // Find ViewPoint
      if(conform != null) {
        Iterator<Element> itElt = conform.getBase_Dependency().getTargets().iterator();
        while(itElt.hasNext()) {
          Element currentElt = itElt.next();
          viewPoint = UMLUtil.getStereotypeApplication(currentElt, ViewPoint.class);
        }
      }
    }
    return viewPoint;
View Full Code Here


   * @return UML property fully qualified name
   */
  public static String buildFullyQualifiedName(Property prop) {
    String name = new String();
    if(prop!=null) {
      Element owner = prop.getOwner();
      if(owner instanceof Type) {
        Type cl = (Type)owner;
        String containerName =
          ClassifierService.buildFullyQualifiedName(cl);
        name = containerName + '#' + codeSimpleNameExtraction(prop);
View Full Code Here

        if(
            (general!=null)
            &&(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) {
View Full Code Here

        if(currentAllocate != null) {
          EList<Element> targets = currentAllocate.getBase_Abstraction().getSources();
          Iterator<Element> it = targets.iterator();
          while(it.hasNext()) {
            Element currentElt = it.next();
            if(currentElt instanceof NamedElement) {
              allocatedFrom.add((NamedElement)currentElt);
            }
          }
        }
View Full Code Here

      Activator.log("The selected uri (" + modelUri.toString() + ") does not contain any model library !");
      return false;
    }

    // Try to reach model
    Element root = (Element)modelResource.getContents().get(0);

    if(root instanceof Package) {

      // Import model library
      Package libToImport = (Package)(modelResource.getContents().get(0));
View Full Code Here

          + uri.toString()));
      return null;
    }

    // Try to reach model
    Element root = (Element)modelResource.getContents().get(0);

    if(root instanceof Package) {

      // Import model library
      Package libToImport = (Package)(modelResource.getContents().get(0));
View Full Code Here

      Activator.log("The selected uri (" + modelUri.toString() + ") does not contain any model library !");
      return false;
    }

    // Try to reach model
    Element root = (Element)modelResource.getContents().get(0);

    if(root instanceof Package) {

      // Import model library
      Package modelToImport = (Package)(modelResource.getContents().get(0));
View Full Code Here

      System.out.println(PREFIX_MESSAGE+"Incorrect given element");
      return;
      // no action taken
    }
   
    final Element UmlElement = (Element)element;
   
    TransactionalEditingDomain tempDomain = null
    try {
        tempDomain  = ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(UmlElement);
    } catch (ServiceException e) {
        System.err.println(e);
    }
   
    //test for the domain
    if (null == tempDomain){
      System.out.println(PREFIX_MESSAGE+"Editing Domain is null");
      return;
      //no action taken
    }
   
    final TransactionalEditingDomain domain = tempDomain;
   
    //open a command do allow undo of all command in one undo
   

    RecordingCommand CompleteCMD = new RecordingCommand(domain) {
 
      protected void doExecute() {     

        //get top package
        org.eclipse.uml2.uml.Package topPackage = UmlElement.getNearestPackage();
       
        while (topPackage.getOwner() instanceof Package){
          topPackage = (Package)topPackage.getOwner();
          //recursively take nearest package until reaching the top
        }
View Full Code Here

   *            The <code>org.eclipse.uml2.uml.Element</code> to find the
   *            nearest package for
   * @return The nearest Package or null
   */
  private Package findNearestPackage(Element el) {
    Element o = el.getOwner();
    while (!(o instanceof Package) && (o != null)) {
      o = o.getOwner();
    }
    if (o instanceof Package) {
      if (o instanceof Model || o instanceof Profile) {
        return null;
      } else {
View Full Code Here

   *            The <code>org.eclipse.uml2.uml.Element</code> to find the
   *            nearest component for
   * @return The nearest Component or null
   */
  private Component findNearestComponent(Element el) {
    Element o = el.getOwner();
    while (!(o instanceof Component) && (o != null)) {
      o = o.getOwner();
    }
    if (o != null) {
      return (Component) o;
    } else {
      return null;
View Full Code Here

TOP

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

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.