Bug 528402 - [View Model Editor] Category context menu does not show all available child elements for creation
Summary: [View Model Editor] Category context menu does not show all available child e...
Status: CLOSED FIXED
Alias: None
Product: ECP
Classification: Modeling
Component: EMF Forms (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.18.0   Edit
Assignee: Lucas Koehler CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
: 535112 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-12-11 05:38 EST by Lucas Koehler CLA
Modified: 2018-06-14 05:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Koehler CLA 2017-12-11 05:38:20 EST
The context menu of a Categorization's Category does not show all possible view model elements that can be created as a child of the category.
For instance, Group, TableControl and Stack Layout are missing.
Comment 1 Lucas Koehler CLA 2018-03-23 10:40:53 EDT
The reason for the missing child elements results from a combination of multiple reasons:

1. The VCategory does not extend VContainer or another type from the core view.ecore that needs child descriptors for VContainedElements.

2. Child descriptors are provided by child creation extenders. These are registered for a specific namespace URI of an EPackage. All our View Model Extensions are only registered to the NS URI of the view.ecore. Consequently, these child creation extenders are not directly known to the adapter factory of the categorization edit bundle.

3. For other view model elements (like the vertical layout) that extend proper elements from the view.ecore, point 2 is no problem because an element also gets all child creation extenders of their super classes. However, Category's super class in the view.ecore is VElement which only gets child creation extenders for packages containing VAttachments.

4. Even if we get all relevant child creation extenders manually (like in the ChildrenDescriptorCollector) we cannot get the child descriptors. The reason for this is that these extenders again only return the child descriptors for types known to them and their super types. Consequently, we again only get the child descriptors for VElement.

One idea to circumvent these problems would be to get all child descriptors for a VContainer. However, for this we would need an instance of VContainer (which is abstract) or one of its sub-types. Furthermore, it needs to be in the correct editing domain and the child descriptors would have to be manually adapted to the VCategory because they use a specific EReference. In conclusion, this does not seem like a good idea if it's even possible.

The cleaner solution would be to change VCategory to be a VContainer (which it should have been from the start). However, this would need a custom migration.
Comment 2 Lucas Koehler CLA 2018-06-05 08:18:39 EDT
Decision: For now the additional child descriptors are gathered by getting the descriptors for a VerticalLayout and transforming them to fit the VCategory.
For 2.0.0, VCategory will extend VContainer.
Comment 3 Eclipse Genie CLA 2018-06-05 08:24:26 EDT
New Gerrit change created: https://git.eclipse.org/r/124001
Comment 4 Lucas Koehler CLA 2018-06-05 08:30:36 EDT
REGRESSION INFORMATION
Summary of the critical part of the change:
There are more entries in the Category's context menu in the View Model Editor.

Potential regressions:
User could create unexpected elements in the view model

Affected areas / use cases
Editing view models in the view model editor

Things that shall be tested
All needed context menu entries are still there.
There are no unwanted context menu entries.
Comment 6 Lucas Koehler CLA 2018-06-14 04:54:54 EDT
*** Bug 535112 has been marked as a duplicate of this bug. ***