addLabelCell(item, day);
EffortDurationPicker normalDurationPicker = new EffortDurationPicker();
normalDurationPicker.initializeFor24HoursAnd0Minutes();
EffortDurationPicker extraDurationPicker = new EffortDurationPicker();
Checkbox unlimitedCheckbox = createUnlimitedCheckbox();
addNormalDurationCell(item, normalDurationPicker);
addExtraEffortCell(item, extraDurationPicker, unlimitedCheckbox);
CapacityPicker capacityPicker = CapacityPicker.workWith(unlimitedCheckbox,
normalDurationPicker,
extraDurationPicker, new Getter<Capacity>() {
@Override
public Capacity get() {
return baseCalendarModel.getCapacityAt(day);
}
}, new Setter<Capacity>() {
@Override
public void set(Capacity value) {
baseCalendarModel.setCapacityAt(day, value);
reloadDayInformation();
}
});
capacityPicker.setDisabled(baseCalendarModel.isDerived()
&& baseCalendarModel.isDefault(day));
Listcell inheritedListcell = new Listcell();
if (baseCalendarModel.isDerived()) {
Checkbox inheritedCheckbox = Util.bind(new Checkbox(),
new Util.Getter<Boolean>() {
@Override
public Boolean get() {
return baseCalendarModel.isDefault(day);
}
}, new Util.Setter<Boolean>() {
@Override
public void set(Boolean value) {
if (value) {
baseCalendarModel.setDefault(day);
} else {
baseCalendarModel.unsetDefault(day);
}
}
});
inheritedCheckbox.addEventListener(Events.ON_CHECK,
new EventListener() {
@Override
public void onEvent(Event event) {
reloadCurrentWindow();