addressCols[3] = new Field("city", "City");
addressCols[4] = new Field("state", "State");
addressCols[5] = new Field("zip", "Zip");
factory.add(StateLookup.class,
new BoundWidgetProvider() {
public BoundWidget get() {
Label label = new Label();
label.setRenderer(new Renderer() {
public Object render(Object o) {
return (o == null) ? "" : ((StateLookup) o).code;
}
});
return label;
}
});
factory.add(TypeLookup.class,
new BoundWidgetProvider() {
public BoundWidget get() {
TextBox label = new TextBox();
label.setRenderer(new Renderer() {
public Object render(Object o) {
return (o == null) ? "" : ((TypeLookup) o).name;
}
});
return label;
}
});
factory.add(String.class, BoundWidgetTypeFactory.LABEL_PROVIDER);
factory.add(Address.class,
new BoundWidgetProvider() {
public BoundWidget get() {
AddressEdit e = new AddressEdit();
e.setAction(new AddressEditAction());
return e;