}
protected void updateView(){
CalendarService service=CalendarService.getInstance();
WorkingCalendar wc=form.getCalendar();
if (wc.isBaseCalendar()) {
basedOnText.setText(" "); // a space. need a space for vertical spacing //$NON-NLS-1$
} else {
basedOnText.setText(Messages.getString("ChangeWorkingTimeDialogBox.BasedOn") + wc.getBaseCalendar().getName()); //$NON-NLS-1$
}
long first=sdCalendar.getFirstDisplayedDate();
long last=sdCalendar.getLastDisplayedDate();
Calendar calendar=DateTime.calendarInstance();
calendar.setTimeInMillis(first);
sdCalendar.setFlaggedDates(null);
sdCalendar.setColorDates(null);
DayDescriptor day;
ArrayList flaggedDates=new ArrayList();
ArrayList colorDates=new ArrayList();
while(calendar.getTimeInMillis()<=last){
day=service.getDay(wc,calendar.getTimeInMillis());
if (day.isModified())
flaggedDates.add(new Long(calendar.getTimeInMillis()));
if (!day.isWorking())
colorDates.add(new Long(calendar.getTimeInMillis()));
calendar.add(Calendar.DATE,1);
}
if (flaggedDates.size()>0)
sdCalendar.setFlaggedDates(toLongArray(flaggedDates));
if (colorDates.size()>0)
sdCalendar.setColorDates(toLongArray(colorDates));
boolean colorWeekDates[] = new boolean[7];
boolean flaggedWeekDates[] = new boolean[7];
for (int i =0; i < 7; i++) {
day = service.getWeekDay(wc,i+1);
if (day.isModified())
flaggedWeekDates[i] = true;
if (!day.isWorking())
colorWeekDates[i] = true;
}