How to add comments for any Model Object [message #478120] |
Wed, 14 January 2009 05:27  |
Eclipse User |
|
|
|
Hi All;
By using given types of code, I am comfortable to generate any type of
Model Object like Class, Activity, Edge, Control Flow etc.
org.eclipse.uml2.uml.Class class = package.createOwnedClass("My Class",
isAbstract);
But I am unable to add/generate the comment tag in the generated .uml
file. Due to not given any method like setComments() etc.
Please let me tell that How can I add comments in my .uml file for any
generated model object.
Thanks in Advance
Kishore
|
|
|
Re: How to add comments for any Model Object [message #478122 is a reply to message #478120] |
Wed, 14 January 2009 10:41   |
Eclipse User |
|
|
|
Hi Kishore,
Element exposes a createOwnedComment() method, or you could call
getOwnedComments().add(myComment).
Since every type in uml extends uml:Element, you should be able to add
comments to any uml Element.
Cheers,
- James.
"kishore " <kishore_74_lko@yahoo.com> wrote in message
news:14e308cec209e0387ecc167aec660fa8$1@www.eclipse.org...
> Hi All;
>
> By using given types of code, I am comfortable to generate any type of
> Model Object like Class, Activity, Edge, Control Flow etc.
>
> org.eclipse.uml2.uml.Class class = package.createOwnedClass("My Class",
> isAbstract);
>
>
> But I am unable to add/generate the comment tag in the generated .uml
> file. Due to not given any method like setComments() etc.
>
>
> Please let me tell that How can I add comments in my .uml file for any
> generated model object.
>
>
>
> Thanks in Advance
> Kishore
|
|
|
|
|
Re: How to add comments for any Model Object [message #478126 is a reply to message #478125] |
Fri, 16 January 2009 17:42  |
Eclipse User |
|
|
|
Note that, technically, there is a difference between the owner of a comment
(which will be assigned when using the factory method James referenced) and
the elements to which the comment applies (which will not be automatically
assigned). To indicate that an element is annotated by a comment (i.e. that
the comment applies to it), you'll need to add it like this:
myComment.getAnnotatedElements().add(myElement);
It's probably most common for the owner of a comment to be (one of) the
annotated element(s), but this isn't necessarily always the case...
Kenn
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:gklmsg$slm$1@build.eclipse.org...
> Very interesting .. that's a good point. Thanks for pointing that out.
>
> - James.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:gklars$emf$1@build.eclipse.org...
>> Even to comments!
>>
>> ;-)
>>
>>
>> James Bruck wrote:
>>> Hi Kishore,
>>>
>>> Element exposes a createOwnedComment() method, or you could call
>>> getOwnedComments().add(myComment).
>>> Since every type in uml extends uml:Element, you should be able to add
>>> comments to any uml Element.
>>>
>>> Cheers,
>>> - James.
>>
>> -----8<-----
>
>
|
|
|
Re: How to add comments for any Model Object [message #627328 is a reply to message #478120] |
Wed, 14 January 2009 10:41  |
Eclipse User |
|
|
|
Hi Kishore,
Element exposes a createOwnedComment() method, or you could call
getOwnedComments().add(myComment).
Since every type in uml extends uml:Element, you should be able to add
comments to any uml Element.
Cheers,
- James.
"kishore " <kishore_74_lko@yahoo.com> wrote in message
news:14e308cec209e0387ecc167aec660fa8$1@www.eclipse.org...
> Hi All;
>
> By using given types of code, I am comfortable to generate any type of
> Model Object like Class, Activity, Edge, Control Flow etc.
>
> org.eclipse.uml2.uml.Class class = package.createOwnedClass("My Class",
> isAbstract);
>
>
> But I am unable to add/generate the comment tag in the generated .uml
> file. Due to not given any method like setComments() etc.
>
>
> Please let me tell that How can I add comments in my .uml file for any
> generated model object.
>
>
>
> Thanks in Advance
> Kishore
|
|
|
Re: How to add comments for any Model Object [message #627330 is a reply to message #478122] |
Wed, 14 January 2009 13:28  |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Even to comments!
;-)
James Bruck wrote:
> Hi Kishore,
>
> Element exposes a createOwnedComment() method, or you could call
> getOwnedComments().add(myComment).
> Since every type in uml extends uml:Element, you should be able to add
> comments to any uml Element.
>
> Cheers,
> - James.
-----8<-----
|
|
|
Re: How to add comments for any Model Object [message #627331 is a reply to message #478124] |
Wed, 14 January 2009 16:55  |
Eclipse User |
|
|
|
Very interesting .. that's a good point. Thanks for pointing that out.
- James.
"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:gklars$emf$1@build.eclipse.org...
> Even to comments!
>
> ;-)
>
>
> James Bruck wrote:
>> Hi Kishore,
>>
>> Element exposes a createOwnedComment() method, or you could call
>> getOwnedComments().add(myComment).
>> Since every type in uml extends uml:Element, you should be able to add
>> comments to any uml Element.
>>
>> Cheers,
>> - James.
>
> -----8<-----
|
|
|
Re: How to add comments for any Model Object [message #627332 is a reply to message #478125] |
Fri, 16 January 2009 17:42  |
Eclipse User |
|
|
|
Note that, technically, there is a difference between the owner of a comment
(which will be assigned when using the factory method James referenced) and
the elements to which the comment applies (which will not be automatically
assigned). To indicate that an element is annotated by a comment (i.e. that
the comment applies to it), you'll need to add it like this:
myComment.getAnnotatedElements().add(myElement);
It's probably most common for the owner of a comment to be (one of) the
annotated element(s), but this isn't necessarily always the case...
Kenn
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:gklmsg$slm$1@build.eclipse.org...
> Very interesting .. that's a good point. Thanks for pointing that out.
>
> - James.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:gklars$emf$1@build.eclipse.org...
>> Even to comments!
>>
>> ;-)
>>
>>
>> James Bruck wrote:
>>> Hi Kishore,
>>>
>>> Element exposes a createOwnedComment() method, or you could call
>>> getOwnedComments().add(myComment).
>>> Since every type in uml extends uml:Element, you should be able to add
>>> comments to any uml Element.
>>>
>>> Cheers,
>>> - James.
>>
>> -----8<-----
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05438 seconds