Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333393

Summary: [ClassDiagram] Association should enable to add stereotype to association property.
Product: [Modeling] Papyrus Reporter: Wojciech Trocki <wtrocki>
Component: DiagramAssignee: Project Inbox <mdt-papyrus-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: arlehmann, baudryvincent, cletavernier, Patrick.Tessier, wtrocki
Version: 0.10.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot (png file) none

Description Wojciech Trocki CLA 2011-01-02 17:28:45 EST
Build Identifier: 

For example We have class A and B. I make association between classes in editor and class A has now new property. Papyrus editor should enable to add stereotype to this property. For now this is possible only on model explorer. 
In Cea Papyrus this work's when association name is selected. 
Please comment if this is incorrect solution.

Reproducible: Always
Comment 1 Wojciech Trocki CLA 2011-01-04 04:38:00 EST
Created attachment 185986 [details]
Screenshot (png file)
Comment 2 Wojciech Trocki CLA 2011-01-13 04:34:50 EST
Problem is in association implementation.
Adding stereotype to owned end property adds stereotype to the whole association. 
This bug broke all association modeling in class diagram.
Comment 3 Missing name Mising name CLA 2011-10-18 11:06:09 EDT
Still the same in 0.8.1, we also need to be able to add stereotypes on association's properties without browsing the model.
Comment 4 Missing name Mising name CLA 2011-10-19 09:02:46 EDT
If that can help, it seems that the problem is, that behind AssociationEndTargetEditPart the model resolved is the Association which might make sens as the property doesn't have a own life. 

There is a special case in the getAdapter(Class) method for IPropertySource but it doesn't seem to be called now (maybe it was ok in earlier versions of Eclipse ???). This special case uses resolveSemanticElement() method instead of getParent().getAdapter(), which might be what we want in our case (as it returns the Property and not the Association).

The problem is that the only discriminant we see here is the Class argument, and we only seem to see org.eclipse.gmf.runtime.notation.View, org.eclipse.emf.ecore.EObject, org.eclipse.gef.AccessibleEditPart or org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor classes as parameters when clicking on the property. org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor is resolved by null by the Adapter, maybe this might be a good lead ? 

We successfully had the desired behaviour by using systematically resolveSemanticElement() when the paramater is an org.eclipse.emf.ecore.EObject.class, but it really isn't a solution as we have no ideas about side effects of this maneuver.
Comment 5 Arnaud Lehmann CLA 2011-12-16 09:04:15 EST
As a workaround, I have defined a new context (org.eclipse.papyrus.properties.context), and I have added the stereotypes (from the selected property) to the profile tab.
It would be great to have this directly in Papyrus.

Another solution would be to have the property and not the association in the property view, if the label is selected. But in this case, the type selection should be disabled.
Comment 6 Patrick Tessier CLA 2013-02-13 05:57:33 EST
this bug has been reproduced in the version 0.9.2
Comment 7 Camille Letavernier CLA 2013-03-25 08:32:27 EDT
This bug still appears in version 0.10.0