public void setModelValue(Object model, Object value) throws Exception {
((OrderSource) model).setSumGreaterThan((Double) value);
}
};
DoubleFormatter formatter = new DoubleFormatter();
formatter.setAcceptEmptyValues(true);
TextEditor editor = new TextEditor();
editor.setSize(10);
editor.setFormatter(formatter);
FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);
context.addFieldInfo(fieldInfo);
}
{
// -------------
// Sum less than
// -------------
String id = OrderSource.SUM_LESS_THAN_ATTR;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return ((OrderSource) model).getSumLessThan();
}
public void setModelValue(Object model, Object value) throws Exception {
((OrderSource) model).setSumLessThan((Double) value);
}
};
DoubleFormatter formatter = new DoubleFormatter();
formatter.setAcceptEmptyValues(true);
TextEditor editor = new TextEditor();
editor.setSize(10);
editor.setFormatter(formatter);
FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);