| Summary: | [ClassDiagram] Association should enable to add stereotype to association property. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Papyrus | Reporter: | Wojciech Trocki <wtrocki> | ||||
| Component: | Diagram | Assignee: | 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
Wojciech Trocki
Created attachment 185986 [details]
Screenshot (png file)
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. Still the same in 0.8.1, we also need to be able to add stereotypes on association's properties without browsing the model. 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. 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. this bug has been reproduced in the version 0.9.2 This bug still appears in version 0.10.0 |