|
Re: Different property view for Association:memberEnd [message #1470602 is a reply to message #1465345] |
Wed, 12 November 2014 13:23 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Emilio,
There is no specific support for manipulating indices in the properties view (Especially because UML Associations can have more than 2 ends). However, the properties view framework can be used to emulate "derived" properties for associations (e.g. memberEnd1 and memberEnd2), which can then be used as any other real property in the properties view editor. It can be a little bit tricky to setup, because you cannot directly modify the Papyrus source code; so there are a few indirections to add:
- Create a new DataContextRoot in the Properties view configuration (e.g. ExtendedUML)
- Create a new DataContextElement (Association)
- Create 2 properties (memberEnd1 and memberEnd2)
Then you need to associate your own ModelElementFactory + ModelElement implementation, to tell the properties view how to (semantically) handle these new properties. To do that, see the help in Papyrus (F1 > Contents > Papyrus Guide > User Guide > Properties view customization), and see the chapters Environment model/Model Element/Model Element Factory
That's a lot of steps to properly configure it (Environments and ModelElements could really be simplified...), but once it's done properly, the properties can be manipulated as if they were actual Metamodel properties, and you have a fine granularity to implement their semantics in the ModelElement (Getter/Setter, Editable/Read-only, Content/Label providers for references, etc.). And most of the time, you only need one ModelElement/ModelElementFactory for any number of derived properties
HTH,
Camille
Camille Letavernier
|
|
|
Powered by
FUDForum. Page generated in 0.03472 seconds