[EMF Forms] Displaying structured models [message #1386094] |
Fri, 13 June 2014 11:58 |
Tomasz Kleszczyński Messages: 2 Registered: May 2014 |
Junior Member |
|
|
Hello,
I'm investigating the way of using EMF Forms in order to display model with nested structures. This means it is not known in advance how nested elements are organized. Within this model there are collections which can contain objects of different classes (see example below).
Consider following domain model:
class Element
description: EString
class Container extends Element
name: EString
children: EList<Element>
class ClassOne extends Element
property1: EString
class ClassTwo extends Element
property2: EDouble
and instance of this model.
Container[name='foo']
children:
ClassOne[property1='bar']
ClassTwo[property2=5]
Container[name='foo1']
children:
ClassTwo[property2=1]
The goals I would like to achieve:
- consistent, reusable way displaying UI for Elements like ClassOne (here I see possibility to implement my own renderers)
- consistent, reusable logic for displaying embedded objects
Based on the fact that the view model binds VControl elements with properties from the domain model, can EMF Forms address such issue? Each of my domain objects can contain different elements.
One of the ideas is generating a separate view model for each instance of the domain model.
Second one is implementing custom renderers for elements like Container, ClassOne, ClassTwo.
Best regards,
Tomek
[Updated on: Mon, 16 June 2014 06:24] Report message to a moderator
|
|
|
Re: [EMF Forms] Displaying structured models [message #1386261 is a reply to message #1386094] |
Mon, 16 June 2014 08:43 |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
Hi Tomek,
in general, it is absolutly possible to bind controls to attributes of
subelements. This is typically done, if the containment relationship is
1:1. In your case: How do you want the UI to look like at the end?
Wouldn't it make sense to display a tree on the left showing the
hierarchy and then showing the elements details on the right?
Best Regards
Jonas
Am 13.06.2014 15:04, schrieb Tomasz Kleszczyński:
> Hello,
>
> I'm investigating the way of using EMF Forms in order to display model
> which is not 'static'. This means it's structure is not known in advance.
>
> Consider following domain model:
>
> class Element
> description: EString
>
> class Container extends Element
> name: EString
> children: EList<Element>
>
> class ClassOne extends Element
> property1: EString
>
> class ClassTwo extends Element
> property2: EDouble
>
> and instance of this model.
>
> Container[name='foo']
> children:
> ClassOne[property1='bar']
> ClassTwo[property2=5]
> Container[name='foo1']
> children:
> ClassTwo[property2=1]
>
> The goals I would like to achieve:
> - consistent, reusable way displaying UI for Elements like ClassOne
> (here I see possibility to implement my own renderers)
> - consistent, reusable logic for displaying embedded objects
>
> Based on the fact that the view model binds VControl elements with
> properties from the domain model, can EMF Forms address such issue? Each
> of my domain objects can contain different elements.
>
> One of the ideas is generating a separate view model for each instance
> of the domain model.
> Second one is implementing custom renderers for elements like Container,
> ClassOne, ClassTwo.
>
> Best regards,
> Tomek
|
|
|
|
Re: [EMF Forms] Displaying structured models [message #1386398 is a reply to message #1386270] |
Tue, 17 June 2014 10:26 |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
I see!
What I would do is creating a custom renderer for the existing element
tree-master-detail. If there are any detailed forms within the sections,
I would define own view models for them and embedd them into the custom
renderer. We have implemented this in a client project before, but as
this is a very specific case, it did not become open source.
Please let me know, if you need support for this...
Best Regards
Jonas
Am 16.06.2014 11:43, schrieb Tomasz Kleszczyński:
> Hi,
> the model I have has 1:n relationship. This 1:n can be nested within each level.
>
> This is concept how generated form for domain object from my previous post should look like:
>
>
> Each Container is represented as titled (using one of domain object feature), expandable pane.
> Other Elements can shown in the following way: label comes from some domain model attribute, value from another (values can be visualized using different UI elements, depending on the attrubute type). however, the same class of objects should be visualized coherently.
>
> I think tree with details is not enough as it should be possible to show whole content at once. Depth of containers is also not limited. Do you have any remarks, advices?
>
> Best regards,
> Tomek
>
|
|
|
Powered by
FUDForum. Page generated in 0.02670 seconds