Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to override the "delete" and "save" strategy
How to override the "delete" and "save" strategy [message #1696887] Fri, 29 May 2015 08:45 Go to next message
Thanh Liem Phan is currently offline Thanh Liem PhanFriend
Messages: 28
Registered: January 2015
Junior Member
Hi,
I have created a library of components, so when I drag&drop a component from library to an IBD (or composite structure diagram), it will :
- create a part of component (action by default) (such as PV : PV)
- copy the parameters of component as properties
- rename the parameters (put a prefix as name of the created part, such as PV_peakPower)
index.php/fa/22001/0/

In order to this, I've overrided the org.eclipse.papyrus.infra.gmfdiag.dnd.dropStrategy. It works perfectly.

However, I also want to override the "delete" and "save" strategy.

"Delete strategy" : when a part is selected in the IBD and then is deleted
- delete selected part (action by default)
- delete all the parameters with the prefix as name of the part to be deleted

"Save strategy": when a part is renamed
- rename the selected part (action by default)
- rename its parameters also.

Which extension points allow me to do these?

Thanks for your help.
Re: How to override the "delete" and "save" strategy [message #1696891 is a reply to message #1696887] Fri, 29 May 2015 09:01 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

This is better done through the Elements Types framework, which is unfortunately not properly documented yet. The idea is to bind some specific Advices (Pre/Post actions) associated to the DestroyElementRequests you want to override. This can be done with the Element Types Configuration model in Papyrus Mars. Maybe you can find some relevant examples in UML-RT or SysML1.4 plug-ins (Search for *.elementtypesconfigurations models)

Regarding the Rename action, the approach is similar: you need to bind some post actions (Advice) to a SetRequest affecting the NamedElement#name property, using the Element Types framework

HTH,
Camille


Camille Letavernier
Re: How to override the "delete" and "save" strategy [message #1696925 is a reply to message #1696891] Fri, 29 May 2015 12:02 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi,

Note that the actually semantics and behaviour of element types are
described in the Graphical Modeling Framework Run-time documentation in
the on-line help. What isn't so much documented yet is the
construction of the configuration models (which exactly mimic the GMF
extension point) and how to integrate them into Papyrus.

Cheers,

Christian

On 2015-05-29 09:01:06 +0000, Camille Letavernier said:

> Hi,
>
> This is better done through the Elements Types framework, which is
> unfortunately not properly documented yet. The idea is to bind some
> specific Advices (Pre/Post actions) associated to the
> DestroyElementRequests you want to override. This can be done with the
> Element Types Configuration model in Papyrus Mars. Maybe you can find
> some relevant examples in UML-RT or SysML1.4 plug-ins (Search for
> *.elementtypesconfigurations models)
>
> Regarding the Rename action, the approach is similar: you need to bind
> some post actions (Advice) to a SetRequest affecting the
> NamedElement#name property, using the Element Types framework
>
> HTH,
> Camille
Re: How to override the "delete" and "save" strategy [message #1696928 is a reply to message #1696925] Fri, 29 May 2015 12:25 Go to previous message
Thanh Liem Phan is currently offline Thanh Liem PhanFriend
Messages: 28
Registered: January 2015
Junior Member
Thanks Camille and Christian,
I will have a look at Element Types Configuration model as you suggest.
Have a nice weekend.
Previous Topic:Code / model syncrhonization feature
Next Topic:Clicking "New Papyrus Project" does nothing
Goto Forum:
  


Current Time: Fri Apr 19 20:15:14 GMT 2024

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

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

Back to the top