event.stopPropagation();
}
public void synchronizeModel() throws ParseException {
SimpleCalendarModel cm = null;
MySimpleCalendarEvent sce = null;
Date beginDate = cal.getBeginDate();
Date endDate = cal.getEndDate();
// first, delete old stuff
cm = (SimpleCalendarModel) cal.getModel();
if (cm != null) {
cm.clear();
}
final SecUser user = ((UserImpl) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getSecUser();
// List<MyCalendarEvent> list =
// getCalendarEventService().getAllCalendarEvents(user.getId());
List<MyCalendarEvent> list = getCalendarEventService().getCalendarEventsFromToDate(beginDate, endDate, user.getId());
cm = new SimpleCalendarModel();
for (MyCalendarEvent myCalendarEvent : list) {
sce = new MySimpleCalendarEvent();
sce.setId(myCalendarEvent.getId());
sce.setUser(myCalendarEvent.getSecUser());
sce.setVersion(myCalendarEvent.getVersion());
sce.setBeginDate(myCalendarEvent.getBeginDate());
sce.setContent(myCalendarEvent.getContent());
sce.setContentColor(myCalendarEvent.getContentColor());
sce.setEndDate(myCalendarEvent.getEndDate());
sce.setHeaderColor(myCalendarEvent.getHeaderColor());
sce.setLocked(myCalendarEvent.isLocked());
sce.setTitle(myCalendarEvent.getTitle());
cm.add(sce);
}
setCalModel(cm);
cal.setModel(cm);
cal.invalidate();