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?