EMF Forms TableControl for derived class [message #1387034] |
Mon, 23 June 2014 15:58 |
Christian Reuter 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 #1387527 is a reply to message #1387138] |
Wed, 25 June 2014 07:57 |
Jonas Helming 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
|
|
|
Powered by
FUDForum. Page generated in 0.03695 seconds