Community
Participate
Working Groups
Papyrus should provide a specific cell editor for properties typed with a Stereotype.
To do that, we need : - a FacetReference to represent the property typed with a Stereotype - A QuerySet to do the set action - A query to get the values to display in the table - A CellEditor 1rst method : - creating a FacetReference typed with Stereotype - creating a CellEditor typed with Stereotype -> doesn't work, because the GetQuery should return Stereotype and it is false : GetQuery returns Elements stereotyped with the wanted stereotype 2nd method : - Creating a FacetReference typed with Element - creating a CellEditor typed with Element ->doesn't work, because the CellEditor hides all other celleditors 3rd method : (see future attachement) - hard code for StereotypedElementCellEditor (like EEnumCellEditor) - we add an EAnnotation to the FacetReference, this EAnnotation contents the name of the stereotype. -> works fine, but we need to change the emf-facet API (see future attachement), and we override Nattablewidget.class 4th method : - add the possibility to declare a CellEditor on a feature (see bug 352566) to declare CellEditor on some facet - not the best solution, because we need to associate this editor to each new FacetReference which represent an object typed with a Stereotype 5th method : - add the possibility to associate a query to a CellEditor. This Query will test the feature (here FacetReference, with its EAnnotation (like in the 3rd method)) to know if the Editor can be chosen to edit the value. - need to implements a default behavior, when no query is provided -> should work, but we need to change the EMF-Facet API -> we need to add a field in the cell editor. This field reference the feature edited by the editor(in order to get the stereotype qualified name) Requirements : - the CellEditor should know which Stereotype is required for the element, in order to filter the elements - the CellEditor should not hide the other editors when it is not useful - NAryEReferenceCellEditor for stereotyped elements - UnaryEReferenceCellEditor for stereotyped elements - distinguish FacetReference (or FacetAttribute?) representing element stereotyped from other FacetReference in order to provide the correct editor. -> we can't distinguish them using the type of the facet, because the "type" is "stereotypedElement". -> I think that we can use the solution proposed in the 3rd method : add an EAnnotation to the FacetReference, with : source = "based_on_Stereotype" (for example) details : key = "Stereotype", value = "qualified name of the stereotype" this qualified name will be used by the celleditor to find the correct value.
Created attachment 200372 [details] An example of facet declaring using EAnnotation This zip contains a UML profile, and a facet to represent its stereotype. The FacetReference use EAnnotation to precise that it represents a property typed with a Stereotype (like described in method 3).
Created attachment 200373 [details] This patch provides emf-facet modification to allow to register specific editor (1) I, Vincent Lorenzo, wrote 100% of the code I've provided. (2) This code contains no cryptography (3) I have the right to contribute the code to Eclipse. (4) I contribute the content under the EPL. I think this patch will be not applied in the EMF-Facet project. It is only here to illustrate a solution for this bug.
Created attachment 200374 [details] This patch modify the PapyrusNattableWidget to register specific CellEditor
The 3 attachments allows to modify the existing plugins to register specific CellEditor (like described in the 3rd method). The zip provides a profile and its corresponding facets to test these change on a new Papyrus model (not yet provided).
This bug can be marked as closed fixed.