private void bindMandatoryDecimalInput(final String label, String property, Text txtValue, Values<?> type)
{
context.bindValue(SWTObservables.observeText(txtValue, SWT.Modify), //
BeansObservables.observeValue(model, property), //
new UpdateValueStrategy() //
.setConverter(new StringToCurrencyConverter(type)) //
.setAfterConvertValidator(new IValidator()
{
@Override
public IStatus validate(Object value)
{
Long v = (Long) value;
return v != null && v.longValue() > 0 ? ValidationStatus.ok()
: ValidationStatus.error(MessageFormat.format(
Messages.MsgDialogInputRequired, label));
}
}), // ,
new UpdateValueStrategy().setConverter(new CurrencyToStringConverter(type)));
}