Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Adaptation of attributes filters in defined MARTE stereotypes
Adaptation of attributes filters in defined MARTE stereotypes [message #1711925] Tue, 20 October 2015 10:23 Go to next message
Kostas Triantafyllidis is currently offline Kostas TriantafyllidisFriend
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 #1712489 is a reply to message #1711925] Mon, 26 October 2015 00:42 Go to previous messageGo to next message
Kostas Triantafyllidis is currently offline Kostas TriantafyllidisFriend
Messages: 15
Registered: March 2011
Junior Member
Hello all,


Since that i did not get any answer from you, i suppose that maybe my question was not clear. Meanwhile i have tried to fix the issue intervening into the source code and make an eclipse plugin. I have downloaded the source code of papyrus and i am trying to understand its functionality and structure in order to make the required changes.

Ideally, i would like to doubleClick on the "OpaqueAction" box and then this event would enable a popup window which would allow me to choose from the filtered MARTE stereotypes.
This would be probably solved if i would be able to add an IDoubleClickListener in the UML activity diagrams or even better in the "OpaqueAction" box.


Despite the fact that i have spent much time on this, i did not manage to find where should i include the IDoubleClick listener. A listener should be added on a viewer instance, ie. viewer.addDoubleClickListener(new event){....}.
But i cannot find where is the viewer instance of the activityDiagram or more specifically of the opaque action. Am i correct or am i missing something?

Does anyone know which plugin/ papyrus package is responsible for handling the activity diagram interface?
The last day i was checking the org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditor class and the org.eclipse.uml.diagram.activity.part.opaqueActionEditPart, but i did not figure out any listeners in the code.
Is there any superclass that inherits the initialization of the activity diagrams?

I would be very pleased if you could give me a hint in which package should i look to add a listener in the papyrus activity diagrams? Is it possible to add a listener on a specific activity diagram node (OpaqueAction)

I am uploading also an activity diagram with the stereotyped Opaque actions.

Thank you in advance for your time.

Best regards,
Kostas
Re: Adaptation of attributes filters in defined MARTE stereotypes [message #1712521 is a reply to message #1712489] Mon, 26 October 2015 09:51 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 920
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 Go to previous message
Kostas Triantafyllidis is currently offline Kostas TriantafyllidisFriend
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 76 times)

[Updated on: Tue, 03 November 2015 04:10]

Report message to a moderator

Previous Topic:Java code generation for operation bodies
Next Topic:SVG customization and comprtments
Goto Forum:
  


Current Time: Sat Feb 22 01:47:40 GMT 2020

Powered by FUDForum. Page generated in 0.05406 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top