Skip to main content



      Home
Home » Eclipse Projects » JFace » Treeviewer with Databinding
Treeviewer with Databinding [message #9210] Tue, 26 May 2009 09:52 Go to next message
Eclipse UserFriend
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 #10260 is a reply to message #9210] Tue, 26 May 2009 12:19 Go to previous messageGo to next message
Eclipse UserFriend
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 #10326 is a reply to message #10260] Tue, 26 May 2009 14:45 Go to previous messageGo to next message
Eclipse UserFriend
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 #10424 is a reply to message #10260] Wed, 27 May 2009 02:55 Go to previous messageGo to next message
Eclipse UserFriend
Hey Tom,

hm the problem is that i dont have any experience with EMF. I already
bought the book about EMF, but i think its very hard to read and
understand, so iŽm just at the beginning of learning EMF.
Nevertheless we dont use EMF yet :-( so i think i cannot use the new
property API or am i wrong ? (like i mentioned before, i didnt understand
much of EMF yet).
Thanks + Greetz
Thomas


Tom Schindl wrote:

> 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
Re: Treeviewer with Databinding [message #10457 is a reply to message #10424] Wed, 27 May 2009 04:08 Go to previous messageGo to next message
Eclipse UserFriend
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

T. Wilhelm schrieb:
> Hey Tom,
>
> hm the problem is that i dont have any experience with EMF. I already
> bought the book about EMF, but i think its very hard to read and
> understand, so iŽm just at the beginning of learning EMF. Nevertheless
> we dont use EMF yet :-( so i think i cannot use the new property API or
> am i wrong ? (like i mentioned before, i didnt understand much of EMF
> yet). Thanks + Greetz
> Thomas
>
>
> Tom Schindl wrote:
>
>> 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
>
>
>
Re: Treeviewer with Databinding [message #10489 is a reply to message #10457] Wed, 27 May 2009 04:49 Go to previous message
Eclipse UserFriend
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

>
Previous Topic:[content assist] Problem with ContentAssist at TextCellEditor
Next Topic:Odd Problem with TextCellEditor
Goto Forum:
  


Current Time: Sun May 11 03:50:13 EDT 2025

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

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

Back to the top