Data Binding

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

Data Binding

Postby Runar Jordahl » Sat Dec 09, 2006 10:03 pm

I wonder how I can do Data Binding using WindowsBuilderPro. I have a class BankAccount defined like this:

public class BankAccount {
private int balance;
public int getBalance() {
return balance;
public void setBalance(int bal) {
balance = bal;

I also have a UI which holds on to an account:

public class BankAccountUi {
private BankAccount account;

Then I add a Spinner to the UI. I want to hook the widget up to the domain object (account) so that getBalance is called whenever the widget is started or the balance changes. Also, setBalance should be called when the user changes the value.

Is there a simple way of doing what I want, using for example JFace Data Binding? Is this directly supported in WindowsBuilderPro? Are there some examples showing how to do this?
Runar Jordahl
Posts: 2
Joined: Sat Dec 09, 2006 12:31 am

Re: Data Binding

Postby Eric Clayberg » Sun Dec 10, 2006 9:12 am

We plan to add support for the brand new JFace Data Binding API in the future. In the meantime, you will need to write data ninding code by hand.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
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 1 guest