|
Re: Class diagram Editor with GMF [message #651704 is a reply to message #651508] |
Tue, 01 February 2011 11:11 |
Ralph Gerbig Messages: 702 Registered: November 2009 |
Senior Member |
|
|
Hi,
Quote: | 1. i want to display attributes in the following form: "attribute name : attribute type". My idea was to use only one label to display both attributes. But it seems the problem is, that only attributes of the corresponding domain element can be chosen from the dialog. In the UML2 Metamodel, the type of a Property is realized by a EReference to the corresponding Element. So my question is: Is there a way to display both attributes using GMF only? Or do i need manual "customization" of the generated code to achieve this?
|
use a Expression Label mapping instead of a feature label mapping. Add a value expression like self.attribute.Name.concat(self.datatype.name). For the correct expression refer to the OCL Language Reference and to your meta model.
Quote: | 2. In the UML2 Metamodel, an association has 2 properties that define the ends of the association (memberEnds, navigableEnds). In the concrete Syntax, an association is drawn between to Classes. How can i model this in GMF?
|
I have no idea how to solve 2) as I am not familar with the meta model you are using. But I think you can react in your editParts handleNotificationEvent method on the changes in navigableEnds and change the figures decorator. This might help you: http://wiki.eclipse.org/GMF/Tips#Making_figures_sensitive_to _attributes_of_semantic_elements
Ralph
[Updated on: Tue, 01 February 2011 11:11] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03269 seconds