Treeviewer with Databinding [message #9210] |
Tue, 26 May 2009 09:52  |
Eclipse User |
|
|
|
Hey all,
i have a problem concering the treeviewer and databinding. I looked at
some snippets but the snippets assume that the Objects you want to display
in the tree are all of the same kind, i.e. only Person objects will be
displayed. Now i have the case that the objects are not the same. At top
there is for example a Box and this Box has some items in it like a
television, a bycicle (so real different things) or whatever. Now i havent
got any idea how i can use the databinding concepts with this tree. In
addition to the problem of different classes in the tree, my tree has
about 6 columns :-(
I found an article where this problem was already mentioned and Tom
Schindl said that it is a problem but he will try to handle it, so Tom if
you read this, did you handle it already? ;-) Or are there any other
solutions / snippets which can help me
Thanks a lot
Thomas
|
|
|
|
Re: Treeviewer with Databinding [message #10326 is a reply to message #10260] |
Tue, 26 May 2009 14:45   |
Eclipse User |
|
|
|
Hi Thomas,
If you are using Java Beans, and not EMF, have a look at the snippets in
this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=268684
Boris
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:gvh4pt$jof$2@build.eclipse.org...
> Yes by using Patched-EMF-Databinding-Lib :-) IIRC the new properties API
> also solves this but Matt can tell you more about it.
>
> EMF 2.5 has the patch on board and also supports the new Property-API.
>
> Tom
>
> T. Wilhelm schrieb:
>> Hey all,
>> i have a problem concering the treeviewer and databinding. I looked at
>> some snippets but the snippets assume that the Objects you want to
>> display in the tree are all of the same kind, i.e. only Person objects
>> will be displayed. Now i have the case that the objects are not the
>> same. At top there is for example a Box and this Box has some items in
>> it like a television, a bycicle (so real different things) or whatever.
>> Now i havent got any idea how i can use the databinding concepts with
>> this tree. In addition to the problem of different classes in the tree,
>> my tree has about 6 columns :-( I found an article where this problem
>> was already mentioned and Tom Schindl said that it is a problem but he
>> will try to handle it, so Tom if you read this, did you handle it
>> already? ;-) Or are there any other solutions / snippets which can help
>> me
>> Thanks a lot
>> Thomas
>>
|
|
|
|
|
Re: Treeviewer with Databinding [message #10489 is a reply to message #10457] |
Wed, 27 May 2009 04:49  |
Eclipse User |
|
|
|
Hey Tom,
ok so i will use the treeviewer in the good old way ;-)
Your solution with the interface i already thought of. My problem here is
that i have a tree with more than 1 column, and every column shows a
detail of the object or nothing and in addition to that some of the cells
are editable others not :-(
Thanks anyway, plz tell me where to find the snippet then, iŽm very
interested in EMF Databinding.
Greetz
Thomas
Tom Schindl wrote:
> Hi,
> No. The properties-API is a concept new to *Eclipse-Databinding* 3.5 so
> you can use it but you need to use Eclipse 3.5. What I referred to was
> that if you have to stick with Eclipse-Databinding 3.4 you'll have no
> choice but have to use (patched)EMF-Databinding.
> If this is not an option the only possibility i see for now is that you
> make your both classes implement an interface say:
> ITreeLabelSupport {
> public void setLabel(String label);
> public String getLabel();
> }
> which makes Databinding happy and once you can switch to 3.5 you'll
> remove the interface which breaks you internal API but is maybe an
> option for you to go on.
> I'm just working on a really small example on using EMF-Databinding
> which I can release to CVS very soon - so this might help you getting
> started with EMF-Databinding.
> Tom
>
|
|
|
Powered by
FUDForum. Page generated in 0.03803 seconds