appendDateboxDate(item);
appendRemoveButton(item);
}
private void appendDecimalBoxValue(final Listitem listitem) {
final AdvanceMeasurement advanceMeasurement = (AdvanceMeasurement) listitem
.getValue();
final Decimalbox value = new Decimalbox();
Listcell listcell = new Listcell();
listcell.appendChild(value);
listitem.appendChild(listcell);
value.setScale(calculateScale(advanceMeasurement));
value.setDisabled(isReadOnlyAdvanceMeasurements()
|| manageOrderElementAdvancesModel
.hasConsolidatedAdvances(advanceMeasurement)
|| manageOrderElementAdvancesModel.isAlreadyReportedProgress(advanceMeasurement));
value.addEventListener(Events.ON_CHANGE, new EventListener() {
@Override
public void onEvent(Event event) {
if (manageOrderElementAdvancesModel
.canRemoveOrChange(advanceMeasurement)) {
updatesValue(value);
validateMeasurementValue(value, value.getValue());
} else {
throw new WrongValueException(
value,
_("Progress Measurement cannot be deleted. Progress Measurement already consolidated"));
}
}
});
Util.bind(value, new Util.Getter<BigDecimal>() {
@Override
public BigDecimal get() {
return advanceMeasurement.getValue();
}
}, new Util.Setter<BigDecimal>() {
@Override
public void set(BigDecimal value) {
if (manageOrderElementAdvancesModel
.canRemoveOrChange(advanceMeasurement)) {
advanceMeasurement.setValue(value);
reloadAdvances();
}
}
});
value.focus();