Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Comment


        }
      }
      if(syntaxTreeNode!=null) {
        Javadoc doc = syntaxTreeNode.getJavadoc();
        if(doc!=null) {
          Comment docComment =
            umlModelElement.createOwnedComment();
          docComment.setBody(doc.toString());       
        }
      }
      setupSuperTypeUMLModelElement();
      for(int i=0 ; i<operationsServices.size() ; i++) {
        operationsServices.get(i).setUpUMLModelElement();
View Full Code Here


    Operation operation = mock(Operation.class,
        Answers.RETURNS_DEEP_STUBS.get());
    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Comment> commentIterator = mock(Iterator.class);
    Comment comment = mock(Comment.class, Answers.RETURNS_DEEP_STUBS.get());

    when(operation.getOwnedComments()).thenReturn(comments);
    when(comments.iterator()).thenReturn(commentIterator);
    when(commentIterator.hasNext()).thenReturn(true, false);
    when(commentIterator.next()).thenReturn(comment);
    when(comment.getBody()).thenReturn(
        "Comment...\nTest\n@author: Lofi Dewanto");

    interfaceGenerator.generateMethodJavadoc(ast, operation, md);

    assertEquals(
View Full Code Here

    Class clazz = mock(Class.class, Answers.RETURNS_DEEP_STUBS.get());
    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Comment> commentIterator = mock(Iterator.class);
    Comment comment = mock(Comment.class, Answers.RETURNS_DEEP_STUBS.get());

    when(clazz.getOwnedComments()).thenReturn(comments);
    when(comments.iterator()).thenReturn(commentIterator);
    when(commentIterator.hasNext()).thenReturn(true, false);
    when(commentIterator.next()).thenReturn(comment);
    when(comment.getBody()).thenReturn(
        "Comment...\nTest\n@author: Lofi Dewanto");

    interfaceGenerator.generateClassJavadoc(clazz, ast, td);

    assertEquals(
View Full Code Here

    Property property = mock(Property.class,
        Answers.RETURNS_DEEP_STUBS.get());
    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Comment> commentIterator = mock(Iterator.class);
    Comment comment = mock(Comment.class, Answers.RETURNS_DEEP_STUBS.get());

    when(property.getOwnedComments()).thenReturn(comments);
    when(comments.iterator()).thenReturn(commentIterator);
    when(commentIterator.hasNext()).thenReturn(true, false);
    when(commentIterator.next()).thenReturn(comment);
    when(comment.getBody()).thenReturn(
        "Comment...\nTest\n@author: Lofi Dewanto");

    interfaceGenerator.generateGetterSetterJavadoc(ast, property, md);

    assertEquals(
View Full Code Here

   
    // Build a mapping of <Element> to <Comment> to find the associated
    // comments fast in the transformation
    for (Element element: sysmlModel.allOwnedElements()) {
      if (element instanceof Comment) {
        Comment comment = (Comment) element;
       
        for (Element e : comment.getAnnotatedElements()) {
          mapping.put(e,  comment);
        }
      }
    }
View Full Code Here

        Object commentsObject = comments.get(i);
        String text = "";
        if (commentsObject instanceof String) {
          text = (String) commentsObject;
        } else if (commentsObject instanceof Comment) {
          Comment c = (Comment) comments.get(i);
          text = c.getBody();
        }

        if (text != null && !"".equals(text)) {
          s = doFormatting(text, s, prefix, annotation);
        } else {
View Full Code Here

   */
  public void createAssociatedStereotype(Element e, String profileQualifiedName, String stereotypeName) {

    applySysMLProfile(e.getModel(), profileQualifiedName);

    final Element element = e;
    final String stereotypeQualifiedName = profileQualifiedName + "::" + stereotypeName;

    final Stereotype stereotype = element.getApplicableStereotype(stereotypeQualifiedName);
    final EList<Stereotype> appliedStereotypes = element.getAppliedStereotypes();

    if (stereotype == null) {
      final String message = "Can't apply the setereotype " + stereotypeQualifiedName + " on "
          + element.toString();
      Activator.log(Status.WARNING, message, null);
    } else if (appliedStereotypes != null && appliedStereotypes.contains(stereotype)) {
      final String message = "The stereotype " + stereotype.getQualifiedName()
          + " is already applied on " + element.toString();
      Activator.log(Status.INFO, message, null);
    } else {
      element.applyStereotype(stereotype);
    }
  }
View Full Code Here

   *            : the given element for which you want to delete the stereotype.
   * @param steQualified
   *            : the qualified name of the stereotype you want to delete (ex. : SysML::Blocks::Block).
   */
  public void deleteAssociatedStereotype(Element e, String steQualified) {
    final Element element = e;

    if (element != null && steQualified != null) {
      final Stereotype stereotype = element.getAppliedStereotype(steQualified);
      if (stereotype != null) {
        element.unapplyStereotype(stereotype);
      }
    } else {
      final String message = "Can't delete the stereotype application because the element or the stereotypeName keys are not correct";
      Activator.log(Status.INFO, message, null);
    }
View Full Code Here

    deleteAssociatedStereotype(e, SYSML_REQUIREMENT);
    final EObject root = getRootContainer(e);
    for (final Iterator<EObject> iterator = root.eAllContents(); iterator.hasNext();) {
      final EObject object = iterator.next();
      if (object instanceof Abstraction) {
        final Element supplier = ((Abstraction)object).getSupplier(e.getName());
        if (supplier != null) {
          Stereotype s = ((Abstraction)object).getAppliedStereotype("SysML::Requirements::Satisfy");
          if (s != null) {
            deleteAssociatedStereotype((Abstraction)object, "SysML::Requirements::Satisfy");
          } else {
View Full Code Here

      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

TOP

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

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.