ItEr29S06CUAsignacionGrupoRecursosAPlanificacionItEr28S06: Now can edit the total hours for each row

This commit is contained in:
Óscar González Fernández 2009-10-09 15:15:39 +02:00
parent 5753c95ded
commit 2ae36fe13b

View file

@ -31,6 +31,7 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.Map.Entry;
import java.util.concurrent.Callable;
import org.joda.time.DateTime;
@ -437,6 +438,7 @@ class Row {
@Override
public void changeOnGlobal() {
reloadAllHours();
reloadHoursSameRowForDetailItems();
}
@Override
@ -484,16 +486,30 @@ class Row {
if (isGroupingRow()) {
return;
}
Intbox intbox = (Intbox) allHoursComponent;
final Intbox intbox = (Intbox) allHoursComponent;
intbox.addEventListener(Events.ON_CHANGE, new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
Integer value = intbox.getValue();
getAllocation().withPreviousAssociatedResources().onInterval(
getAllocation().getStartDate(),
getAllocation().getEndDate())
.allocateHours(value);
fireCellChanged();
reloadHoursSameRowForDetailItems();
reloadAllHours();
}
});
}
private void reloadHoursSameRowForDetailItems() {
for (Entry<DetailItem, Component> entry : componentsByDetailItem
.entrySet()) {
reloadHoursOnInterval(entry.getValue(), entry.getKey());
}
}
private void reloadAllHours() {
if (isGroupingRow()) {
Label label = (Label) allHoursInput;