Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Unsetting stereotype optional properties
Unsetting stereotype optional properties [message #1720735] Wed, 20 January 2016 15:03 Go to next message
German Vega is currently offline German VegaFriend
Messages: 104
Registered: December 2015
Location: Grenoble, France
Senior Member
Hello

I have defined stereotype in a profile with one optional integer attribute (I defined the property using the UML standard primitive integer type, and multiplicity 0..1).

Afterwards, I can apply my profile to the model, and the stereotype to an element. In the property view, in the profile panel, I can edit the property of the stereotype.

However, once I have set a value, there is no way to unset the property, I must enter an integer in the form.

Is there any way in the property view GUI to unset the property ?

The ecore editor has a button "restore default value" in the properties view header, that seems to allow this, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=222754


Another doubt, not sure if it is a Payrus or an UML2 issue :

I have checked the generated ecore, after defining the profile, and the property was converted to an EAttribute of type Integer (an EDatatype defined in the UML model library http://www.eclipse.org/uml2/5.0.0/Types#//Integer) with lower bound 0 and upper bound 1.

Why is it not converted to an unsettable attribute, to be able to distinguish the case of unset versus set to to default value ( 0 in the case of integers) ?
Re: Unsetting stereotype optional properties [message #1720812 is a reply to message #1720735] Thu, 21 January 2016 08:56 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

Quote:
Why is it not converted to an unsettable attribute, to be able to distinguish the case of unset versus set to to default value ( 0 in the case of integers) ?


If you want to generate more accurate Ecore definitions, you should use the Ecore profile. You can apply the EAttribute stereotype to the UML Property, and set isUnsettable=true

However, this won't be sufficient, as Papyrus doesn't implement the "unset" action for primitive type editors

Regards,
Camille


Camille Letavernier
Re: Unsetting stereotype optional properties [message #1721004 is a reply to message #1720812] Fri, 22 January 2016 13:29 Go to previous message
German Vega is currently offline German VegaFriend
Messages: 104
Registered: December 2015
Location: Grenoble, France
Senior Member
Hello

Quote:
If you want to generate more accurate Ecore definitions, you should use the Ecore profile


Ok, fair enough.

Quote:
However, this won't be sufficient, as Papyrus doesn't implement the "unset" action for primitive type editors


but then, it remains the question of whether there is some special treatment in the primitive type editors to handle attributes with multiplicity 0..1 ? or is it handled just like a multiplicity 1..1
Previous Topic:How to edit .notation file by java
Next Topic:Attention: Major API refactorings in Papyrus Neon M5
Goto Forum:
  


Current Time: Thu Apr 25 22:40:17 GMT 2024

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

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

Back to the top