Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [EMF Forms] ViewModel, FeaturePath and Table controls([EMF Forms] ViewModel, FeaturePath and Table control Questions)
[EMF Forms] ViewModel, FeaturePath and Table controls [message #1802062] |
Thu, 31 January 2019 09:39  |
Eclipse User |
|
|
|
Hi,
we have been using EMF Forms for a few years now and we greatly appreciate its features. Nice framework. We are doing not bad but we still think we are missing important feature details. We tried to find infos in examples, code and documentation with no success. We hope someone could guide and give us some tips about the following questions:
- FeaturePath Support
We define view models for specific EObject. Our view models include controls that refer direct structural feature, in other words a feature that belongs to the specified EObject? Is there a way, to refer a feature inside a feature of that EObject. Is it possible to have a kind of FeaturePath? With the view model editor, we are unable to figure out how to model such FeaturePath.
- Level of customisation of Table control
a) Is there a recommended way to customize columns (e.g. Label provider, cell renderer etc) through the viewModels. Is it possible to customize the getText/getImage for each column?
b) If we want to customize the buttons (+, -, up, down), and if we want to add and support new buttons what is the best strategy? We are thinking about including custom annotations and implement a renderer that expands customize and default features.
- Extend EMFForm view model meta-model
EMF is extensible by default. Do you recommend to use custom annotation and custom renderer to add features to the default EMF Forms framework, or to create a new EMF Forms ++ meta-model that extends default EMF Forms view model meta-model. e.g. CustomTableControl extends DefaultEMFFormsTableControl. We'd like to stay as close as possible to the default use case.
- Advanced EMF Forms view model examples
Is there a place to look for advanced use of view models with complex Feature Reference etc.
I know there are a lot of questions. Help and tips would be appreciated. Meanwhile we continue to dig into the world of EMF Forms.
Thanks ;-)
|
|
|
Re: [EMF Forms] ViewModel, FeaturePath and Table controls [message #1802103 is a reply to message #1802062] |
Fri, 01 February 2019 03:50   |
Eclipse User |
|
|
|
Hi,
Happy to hear that EMF Forms works well for your use case!
About 1:
From your description, I am not 100% sure, whether I understand your requirement. Do you want to reference a feature, which is defined by a sub object of the root EObject. As an example, if you have person as a root object and a person containing an address, do you want to show a control with "street" (being a feature of address). This would be supported, if you want something else, please provide an example.
About 2 a): You can register cell renderers to implement any behavior. If you want to configure that in the view model, you need to add an option, either to the view model or to the template model (i.e. styling)
about 2 b): Best strategy is to customize the table renderer. The parts creating the buttons can be overriden. If you want to have this configurable in the view model or the template model, you again need to add this option.
about 3: An annotation is the fastest path, but if you use an extension very frequently, you can extend the view meta model, it was designed for that. If the extension is useful for others, too, you might contribute that, so you can even influence the default use case.
About 4: We have customer projects with very advanced use cases and feature references, but those are unfortunately not open source.
I hope I could help, best regards,
Jonas
|
|
| |
Re: [EMF Forms] ViewModel, FeaturePath and Table controls [message #1802207 is a reply to message #1802141] |
Mon, 04 February 2019 04:30  |
Eclipse User |
|
|
|
Hi,
about 1):
Let us assume you have User containing an Address and you create a view model for User. Click on "generate Controls", select the containment reference "address" of user and the Address. Now you should be able to add controls for the attributes of address.
Let me know if that worked for you.
Best regards,
Jonas
|
|
|
Goto Forum:
Current Time: Fri Jun 20 07:48:42 EDT 2025
Powered by FUDForum. Page generated in 0.10248 seconds
|