Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Forms TableControl for derived class
EMF Forms TableControl for derived class [message #1387034] Mon, 23 June 2014 15:58 Go to next message
Christian Reuter is currently offline Christian ReuterFriend
Messages: 34
Registered: October 2010
Member
Hi,

I want to use a TableControl in my view model to display a list of properties contained in the class which is displayed by the view.

The problem is that there are different classes of properties (String, Numeric, etc) which all inherit from the abstract class "Property" that only declares the field "name". The derived property classes declare the field "value" which has different data types depending on the property class. The EReference of my domain model's object is of EType "Property" to allow any kind of property to be linked to my object.

The TableControl does not seem to work with references to abstract classes. I can only select the name-field of the abstract class as a table column (not the value field of the derived classes) and even with the name field only I get a NullponterException when I open the view.

I understand that it is not trivial to support this as the derived classes may have all sorts of different fields.

Is this possible at all?
Does anybody have a different solution for the problem?

Thx,

chris

[Updated on: Tue, 24 June 2014 11:35]

Report message to a moderator

Re: EMF Forms TableControl for derived class [message #1387122 is a reply to message #1387034] Tue, 24 June 2014 09:51 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

i guess the attribute value should be in one column?
This would require a new domain model reference type: Domain model
reference switch. This switch itself would define that there is a
column. As child objects it would contain a domain model reference per
sub type of property, which binds to the attribute of the sub element
(value). It probably also requires an adaptation of the resolver and
probably also of the table itself.
If you want our help in implementing this, please contact me:
jhelming@xxxxxxxx

Best Regards

Jonas

Am 23.06.2014 17:58, schrieb Christian Reuter:
> Hi,
>
> I want to use a TableControl in my view model to display a list of
> properties contained in the class which is displayed by the view.
>
> The problem is that there are different classes of properties (String,
> Numeric, etc) which all inherit from the abstract class "Property" that
> only declares the field "name". The derived property classes declare the
> field "value" which has different data types depending on the property
> class. The EReference of my domain model's object is of EType "Property"
> to allow any kind of property to be linked to my object.
>
> The TableControl does not seem to work with references to abstract
> classes. I can only select the name-field of the abstract class as a
> table column (not the value field of the derived classes) and even with
> the name field only I get a NullponterException when I open the view.
>
> I understand that it is not trivial to support this as the derived
> classes may hahe all sorts of different fields.
> Is this possible at all? Does anybody have a different solution for the
> problem?
>
> Thx,
>
> chris
Re: EMF Forms TableControl for derived class [message #1387138 is a reply to message #1387122] Tue, 24 June 2014 11:32 Go to previous messageGo to next message
Christian Reuter is currently offline Christian ReuterFriend
Messages: 34
Registered: October 2010
Member
Hi Jonas,

Yes I want a table with different data types in the value-column like this:

Properties:
----------------
Name | Value |
----------------
Source | "ESP" |
----------------
Count | 1 |
----------------
Temp | 20.3 |
----------------

Your suggestion sounds quite complicated.
Actually I wanted to use ECP to facilitate and speed up the GUI programming.
Your proposal requires a profound knowledge of the internal structure of ECP and I do not have the time at the moment to dive deeply into this.
I guess a custom control is an easier solution - right?
Do you see any other easy solution or could you provide a sample implementation which could be modified to meet my requirements?

Unfortunately your email adress has not made it into your post in one piece so I can not contact you directly ...

Cheers

chris
Re: EMF Forms TableControl for derived class [message #1387527 is a reply to message #1387138] Wed, 25 June 2014 07:57 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Chris,

I think, the table you need is not a trivial control so any solution
will be some effort, even a manual one. Of course, there is the
alternative to implement a custom control. In this case, I would expect,
that the implementation of a custom control causes at least the same
effort, probably even more compared to the proposed adaptation.
If you do not want to do this yourself, you could consider to sponsor
this enhancement. If you are interested in this, just contact me.
https://www.eclipse.org/ecp/emfforms/communication.html

Best Regards

Jonas



Am 24.06.2014 13:32, schrieb Christian Reuter:
> Hi Jonas,
>
> Yes I want a table with different data types in the value-column like this:
>
> Properties:
> ----------------
> Name | Value |
> ----------------
> Source | "ESP" |
> ----------------
> Count | 1 |
> ----------------
> Temp | 20.3 |
> ----------------
>
> Your suggestion sounds quite complicated.
> Actually I wanted to use ECP to facilitate and speed up the GUI
> programming.
> Your proposal requires a profound knowledge of the internal structure of
> ECP and I do not have the time at the moment to dive deeply into this.
> I guess a custom control is an easier solution - right?
> Do you see any other easy solution or could you provide a sample
> implementation which could be modified to meet my requirements?
>
> Unfortunately your email adress has not made it into your post in one
> piece so I can not contact you directly ...
>
> Cheers
> chris
Previous Topic:Luna required for ECP 1.3.x?
Next Topic:[EMF FORMS] i18n for labels and group
Goto Forum:
  


Current Time: Fri Mar 29 15:48:24 GMT 2024

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

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

Back to the top