Package org.zkoss.calendar.impl

Examples of org.zkoss.calendar.impl.SimpleCalendarModel


    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();
View Full Code Here


    if (top + 100 > evt.getDesktopHeight())
      top = evt.getDesktopHeight() - 100;
    if (left + 330 > evt.getDesktopWidth())
      left = evt.getDesktopWidth() - 330;

    SimpleCalendarModel m = (SimpleCalendarModel) cal.getModel();
    MySimpleCalendarEvent sce = (MySimpleCalendarEvent) evt.getCalendarEvent();
    sce.setBeginDate(evt.getBeginDate());
    sce.setEndDate(evt.getEndDate());
    // update the model
    // m.update(sce); <-- if activated, later an error occurs
View Full Code Here

TOP

Related Classes of org.zkoss.calendar.impl.SimpleCalendarModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.