Problem adding comment [message #559452] |
Thu, 16 September 2010 12:41  |
Eclipse User |
|
|
|
Hi,
I'm adding a comment to a Port and then edit it to set some values:
Comment comment = portCopy.createOwnedComment(); comment.applyStereotype(stereoRtSpec);
portCopy.setValue(stereoRtFeature, "specification", comment);
But I can't see the comment in the model viewer, I'm I attaching it in the wrong place?
Thanks in advance, 123star
|
|
|
Re: Problem adding comment [message #559542 is a reply to message #559452] |
Fri, 17 September 2010 02:21   |
Eclipse User |
|
|
|
Comment comment = portCopy.createOwnedComment();
That will create the comment as a child of the port, but the comment will not be tied to any element. To do that, you need to add the port as an annotated element
comment.getAnnotatedtElements().add(portCopy);
That should take care of the problem (even though I don't know what you are referring to when you say "model viewer") .
However, it seems you also want to apply a stereotype to the comment:
comment.applyStereotype(stereoRtSpec);
That is fine, but then the following line does not make sense:
portCopy.setValue(stereoRtFeature, "specification", comment);
What are you trying to achieve there?
Since you applied the stereotype to the comment, you can only set the tagged value on the comment itself (assuming "specification" is a property in the stereotype, it is now an extended attribute of the element you applied the stereotype to).
Cheers,
Rafael
http://alphasimple.com
|
|
|
|
Re: Problem adding comment [message #559753 is a reply to message #559591] |
Fri, 17 September 2010 17:18  |
Eclipse User |
|
|
|
Sorry, I don't know what "Model explorer" is. Google tells me Papyrus has such thing, so if that is what you are referring to, you might want to ask this question on their newsgroup, as this is the forum for the UML2 API.
Or you can paste the XMI you are generating and we can try to help find problems with the model itself, but diagram rendering issues should be taken to the corresponding forum for the tool you are using.
Cheers,
Rafael
|
|
|
Powered by
FUDForum. Page generated in 0.05631 seconds