*/
private void initNewTableModel(DayUI gui, WeekIndex weekIndex, DayOfWeek dayOfWeek,
SheduleIndividualLocal sil, SheduleProrumbleLocal spl) throws ClipsException {
Day day = weekIndex.getDay(dayOfWeek);
SheduledDay sheeduledDay = new SheduleHelper(spl, sil).getSheduledDay(day);
gui.table.setEnabled(true);
gui.columnName.setText(day + dayOfWeek.getShortTitle());
ComboOption option = options.get(sheeduledDay.getProrumbleItem());
Day tableDay = day;
TimeTableModel tableModel = null;
boolean tableIsReadOnly = true;
if(!sheeduledDay.isWorking()) {
tableModel = new TimeTableModelDefault();
} else if (!sheeduledDay.isByPlan()) {
tableModel = new SheduleIndividualExceptionTableModel(sheeduledDay,
sil, weekIndex, getAuditManager());
option = exceptionOption;
tableIsReadOnly = false;
} else {
WeekIndex planWeekIndex = new WeekIndex(weekIndex.getIndex() % sil.getWeekCount());
tableModel = new SheduleTemplateTableModel(sil, planWeekIndex, getAuditManager());
tableDay = planWeekIndex.getDay(dayOfWeek);
option = planOption;
}
TimeOffset shiftBegin = sheeduledDay.getClinicShiftBegin();
TimeOffset shiftEnd = sheeduledDay.getClinicShiftEnd();
gui.table.setShiftBegin(shiftBegin.getMilliseconds());
gui.table.setShiftEnd(shiftEnd.getMilliseconds());
gui.comboBox.setEnabled(sil.canModifyReal());