|
Project Information
|
Gwt-BeansFramework for generation of bean bindings based on description in xml file. Project is still in early Beta :) Binding are used to synchronize the properties of two objects that emit PropertyChangeEvent. Change in property of one bound object will be automatically propagated to a value of property in another project. ExampleYou can see this example running at http://gwtbeans.appspot.com/ Bindings betweent the properties of two classes are described by xml file. <mappings>
<binding>
<class-a>com.googlecode.wmlynar.gwtbeans.example.client.Application</class-a>
<class-b>com.googlecode.wmlynar.gwtbeans.example.client.ExampleModel</class-b>
<field>
<a>textBox1.text</a>
<b>text</b>
</field>
<field>
<a>textBox2.text</a>
<b>text</b>
</field>
</binding>
</mappings>Where the model code looks looks like this: public class ExampleModel extends AbstractBean {
private String text;
public void setText(final String text) {
support.firePropertyChange("text", this.text, this.text = text);
}
public String getText() {
return text;
}
}The gwt-beans plugin will generate class called BindingGroup. Binding group can be used if following way: textBox1 = new TextBox();
verticalPanel.add(textBox1);
textBox2 = new TextBox();
verticalPanel.add(textBox2);
model = new ExampleModel();
model.setText("example text");
final BindingGroup binding = BindingFactory.createBinding(this, model, null);
binding.bind();
binding.copyBToA();Using Gwt-Beans in your projectSee UsingGwtBinding for details. |