TreeViewer Data Binding with Eclipse 3.4

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

TreeViewer Data Binding with Eclipse 3.4

Postby Mazer » Mon Jul 07, 2008 6:33 am

Hi,

I am new to your community and your product. Today I tried to bind some data from a simple data model to a JFace TreeViewer using the Edit Data Bindings dialog. Obviousely RCPDeveloper 3.5 in combination with Eclipse 3.4 seem to support data binding for trees. At least I was able to walk through the wizard pages and some binding code was generated. Unfortunately the three following imports are missing:

Code: Select all
import com.instantiations.designer.databinding.BeansListObservableFactory;
import com.instantiations.designer.databinding.TreeBeanAdvisor;
import com.instantiations.designer.databinding.TreeObservableLabelProvider;


Do you have any suggestion/idea what I need to change or what I am probably doing wrong? Where can I find the external JAR's? Is there any new documentation e.g. Web Demo for tree data binding available?

Thanks for helping. Best regards,
Mathias
Mazer
 
Posts: 4
Joined: Mon Jul 07, 2008 3:15 am

Re: TreeViewer Data Binding with Eclipse 3.4

Postby Eric Clayberg » Tue Jul 08, 2008 2:49 am

Give the latest SWT Designer v6.7.0 build a try.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: TreeViewer Data Binding with Eclipse 3.4

Postby Mazer » Tue Jul 08, 2008 5:41 am

Dear Eric,

Thanks for your answer. With the new build of the SWT Designer the result was better. I still haven't figured out how to do the tree data binding in a way that the children's label appear. Now my tree view looks like that:

ItemLabel1
| |-
| |-
| |-
ItemLabel2
|-
|-

For every child of my parent items a line appears when the tree is expanded but the labels remain invisible. I believe I am still doing something wrong. Any idea when you will have a detailed documentation of this matter ready (e.g. Web Demo)?

Best regards,
Mathias
Mazer
 
Posts: 4
Joined: Mon Jul 07, 2008 3:15 am

Re: TreeViewer Data Binding with Eclipse 3.4

Postby Eric Clayberg » Tue Jul 08, 2008 4:07 pm

Mazer wrote:Any idea when you will have a detailed documentation of this matter ready (e.g. Web Demo)?

Download the e34-db-example.zip file for a detailed TreeViewer Data Binding Example.

Start by reading the TreeViewerDataBindingExample.pdf tutorial doc included in the above zip file.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: TreeViewer Data Binding with Eclipse 3.4

Postby Mazer » Thu Jul 10, 2008 7:01 am

Dear Eric,

Thank you very much for this excellent example. Now a big part of my example application is running. Unfortunately I am still a bit in trouble regarding the data binding. So I packed my project in a JAR file and attached it. If you find the time to take a look at it I would be really grateful.

In my design I used a simple TreeViewer instead of a CheckboxTreeViewer. It shall contain some device groups which contain devices or further groups - like a file system. Further I created an editor area which allows to add new groups, add new devices, delete groups or devices, choose an icon and edit the shown data.

I can select any group or device in the tree and edit its data (text / image). As soon as I press the "Save" button the tree updates correctly. In the same manner I tried to implement the add and delete functions. Although the data model gets updated right the tree doesn't update at all (only thing is that sometimes the name of a parent group changes when adding a new group!). Is this because I do not have any fired property changes when manipulating the tree structure? What is missing?

Second strange point is my binding of the additional TableViewer to the TreeViewer. It should show two string values of the currently selected device. When selecting a device nothing happens, when selecting a group all values of the child devices are shown. No chance to figure out the problem. I go crazy!

Really sorry for disturbing again. Best regards,
Mathias
Mazer
 
Posts: 4
Joined: Mon Jul 07, 2008 3:15 am

Re: TreeViewer Data Binding with Eclipse 3.4

Postby Eric Clayberg » Thu Jul 10, 2008 4:25 pm

Your post did not include any code, but that's OK since debugging your application really isn't something we can do in this context.

General questions about the Eclipse Data Binding framework are best directed to the eclipse.platform newsgroup.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests