ItEr29S06CUAsignacionGrupoRecursosAPlanificacionItEr28S06: Not allowing negative values at cells

This commit is contained in:
Óscar González Fernández 2009-10-07 19:07:13 +02:00
parent 6eaa363925
commit 0921d44085

View file

@ -392,7 +392,7 @@ class Row {
}
private Component buildAllHours() {
return isGroupingRow() ? new Label() : new Intbox();
return isGroupingRow() ? new Label() : noNegativeIntbox();
}
private void addListenerIfNeeded(Component allHoursComponent) {
@ -452,14 +452,21 @@ class Row {
}
Component hoursOnInterval(DetailItem item) {
Component result = isGroupingRow() ? new Label() : new Intbox();
Component result = isGroupingRow() ? new Label() : noNegativeIntbox();
reloadHoursOnInterval(result, item);
componentsByDetailItem.put(item, result);
addListenerIfNeeded(item, result);
return result;
}
private void addListenerIfNeeded(final DetailItem item, Component component) {
private Intbox noNegativeIntbox() {
Intbox result = new Intbox();
result.setConstraint("no negative, no empty");
return result;
}
private void addListenerIfNeeded(final DetailItem item,
final Component component) {
if (isGroupingRow()) {
return;
}