Adaptation of attributes filters in defined MARTE stereotypes [message #1711925] |
Tue, 20 October 2015 10:23 |
Kostas Triantafyllidis Messages: 15 Registered: March 2011 |
Junior Member |
|
|
Dear all,
I would like to change the filters of the attributes from specific stereotypes for MARTE profile. When i choose the values of specific attributes then the Papyrus filters the attributes depending on the type of the attribute. I would like to filter even more the options for specific attributes depending on the values of other attributes of the same stereotype. Is this possible to be integrated in an eclipse plugin and which classes handle the filtering operations?
I have read this old thread ( https://www.eclipse.org/forums/index.php/t/231681/ ) but it proposes a solution based on OCL which has to be defined by the user every time he defines a diagram, or at least this is what i understood.
Is there any tutorial or code that i can adapt for manipulating the papyrus attributes filters?
Best regards,
Kostas
[Updated on: Tue, 20 October 2015 10:25] Report message to a moderator
|
|
|
|
Re: Adaptation of attributes filters in defined MARTE stereotypes [message #1712521 is a reply to message #1712489] |
Mon, 26 October 2015 09:51 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Kostas,
Diagrams do not rely on the SWT/JFace APIs. Instead, you should rely on the Draw2D API for the basic listeners, and GMF EditPolicyProvider/EditPolicy to install the listener & react to events. EditPolicyProviders can be declared via an extension point.
For an example of Figure listeners contributed via an external plug-in, you can have a look at oep.infra.gmfdiag.css (EventListenerEditPolicy / EventListenerEditPolicyProvider)
- Contribute a new EditPolicyProvider to the org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders extension point [Note: The example I'm referring to is currently disabled in Papyrus, so all the code is here except the actual contribution to the extension point]
- This provider should only be enabled for OpaqueActions in the ActivityDiagram: this filtering happens in the Provider#provides() method. You can check for example that the host edit part is an instanceof OpaqueActionEditPart
- Create an EditPolicy, that installs a listener when activated (And removes it when deactivated), and opens a popup dialog when a double click event is received
In any case, please note that hyperlinks navigation is currently associated to the Double Click event, so in some cases (If some hyperlinks are present on the OpaqueAction), you may have several popups opening at the same time
HTH,
Camille
Camille Letavernier
|
|
|
Re: Adaptation of attributes filters in defined MARTE stereotypes [message #1713267 is a reply to message #1712521] |
Mon, 02 November 2015 21:26 |
Kostas Triantafyllidis Messages: 15 Registered: March 2011 |
Junior Member |
|
|
Hi all,
Camille, your post helped me a lot. I managed to install the events (for single click because double click does not seem to work) but single click is ebough for me. Maybe later i will change to a different event but for now it is sufficient to make my tests.
I have managed also to get the stereotypes, their attributes and values from the activity diagrams, applying the required filtering and processing.
Without your help i would not be able to reach this point, so thank you a lot!
However, i have not managed yet to create the pop up window that will allow me to choose from a list of attributes. I assume there should be a chooser or something in eclipse that could be integrated in a popup window (like the window that opens when someone wants to edit an attribute of a stereotype). Of course the popup window is not a necessity and it could be an integrated in the eclipse views window like the "propterties view" of the papyrus. Is there any plugin that i should focus and check for such a functionality? Then maybe i could extend this plugin based on my needs.
ps: I am attaching a picture of a window that i would like to get, making it easier for you to understand what kind of chooser i would like to have. I should be able to fill the chooser in with elements of my choice.
Thank you in advance.
Best regards,
Kostas
-
Attachment: chooser.jpg
(Size: 37.00KB, Downloaded 105 times)
[Updated on: Tue, 03 November 2015 04:10] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03405 seconds