Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Displaying structured models
[EMF Forms] Displaying structured models [message #1386094] Fri, 13 June 2014 11:58 Go to next message
Tomasz Kleszczyński is currently offline Tomasz KleszczyńskiFriend
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 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
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 #1386270 is a reply to message #1386261] Mon, 16 June 2014 09:43 Go to previous messageGo to next message
Tomasz Kleszczyński is currently offline Tomasz KleszczyńskiFriend
Messages: 2
Registered: May 2014
Junior Member
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:
index.php/fa/18293/0/

Each Container is represented as titled (using value from one of domain object features), expandable pane.
Other Elements can be shown in the following way: label comes from some domain model attribute, value from another one (values can be visualized using different UI elements, depending on the attribute 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

[Updated on: Mon, 16 June 2014 14:03]

Report message to a moderator

Re: [EMF Forms] Displaying structured models [message #1386398 is a reply to message #1386270] Tue, 17 June 2014 10:26 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
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
>
Previous Topic:[EMFStore] Test Plan
Next Topic:[EmfStore] Commit observe on server
Goto Forum:
  


Current Time: Fri Apr 26 12:01:07 GMT 2024

Powered by FUDForum. Page generated in 0.03312 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top