Package org.zkoss.calendar.api

Examples of org.zkoss.calendar.api.CalendarEvent


   
    TimeZone tz = calendars.getDefaultTimeZone();
   
    editEvent.setLeft(left + "px");
    editEvent.setTop(top + "px");
    CalendarEvent ce = evt.getCalendarEvent();
    SimpleDateFormat edit_sdf = new SimpleDateFormat("HH:mm");
    edit_sdf.setTimeZone(tz);
    Calendar calendar = Calendar.getInstance(org.zkoss.util.Locales
        .getCurrent());
    String[] times = edit_sdf.format(ce.getBeginDate()).split(":");
    int hours = Integer.parseInt(times[0]);
    int mins = Integer.parseInt(times[1]);
    int bdTimeSum = hours + mins;
    editEvent$ppbt.setSelectedIndex(hours*12 + mins/5);
    times = edit_sdf.format(ce.getEndDate()).split(":");
    hours = Integer.parseInt(times[0]);
    mins = Integer.parseInt(times[1]);
    int edTimeSum = hours + mins;
    editEvent$ppet.setSelectedIndex(hours*12 + mins/5);
    boolean isAllday = (bdTimeSum + edTimeSum) == 0;
    editEvent$ppbegin.setTimeZone(tz);
    editEvent$ppbegin.setValue(ce.getBeginDate());
    editEvent$ppend.setTimeZone(tz);
    editEvent$ppend.setValue(ce.getEndDate());
    editEvent$ppallDay.setChecked(isAllday);
    editEvent$pplocked.setChecked(ce.isLocked());
    editEvent$ppbt.setVisible(!isAllday);
    editEvent$ppet.setVisible(!isAllday);
    editEvent$ppcnt.setValue(ce.getContent());
    String colors = ce.getHeaderColor() + "," + ce.getContentColor();
    int index = 0;
    if ("#3467CE,#668CD9".equals(colors))
      index = 1;
    else if ("#0D7813,#4CB052".equals(colors))
      index = 2;
View Full Code Here


            }
          });

      if (list != null) {
        for (Iterator it = list.iterator(); it.hasNext();) {
          CalendarEvent ce = (CalendarEvent) it.next();
          if (!ce.getBeginDate().before(ce.getEndDate()))
            throw new IllegalArgumentException("Illegal date: from " + ce.getBeginDate() + " to " + ce.getEndDate());
         
          String key = ce.getBeginDate().before(beginDate) ?
                    getEventKey(beginDate):
                    getEventKey(ce.getBeginDate());
         
          List dayevt =  (List) _evts.get(key);
          if (dayevt == null) {
            dayevt = new LinkedList();
            _evts.put(key, dayevt);
View Full Code Here

   */
  private void initDataListener() {
    if (_dataListener == null)
      _dataListener = new CalendarDataListener() {
        public void onChange(CalendarDataEvent event) {
          CalendarEvent ce = event.getCalendarEvent();
          if (ce == null) {  // if large scope change, such as clearAll
            reSendEventGroup();
            return;
          }
          switch (event.getType()) {
View Full Code Here

            }
          });

      if (list != null) {
        for (Iterator it = list.iterator(); it.hasNext();) {
          CalendarEvent ce = (CalendarEvent) it.next();
          if (!ce.getBeginDate().before(ce.getEndDate()))
            throw new IllegalArgumentException("Illegal date: from " + ce.getBeginDate() + " to " + ce.getEndDate());
         
          String key = ce.getBeginDate().before(beginDate) ?
                    getEventKey(beginDate):
                    getEventKey(ce.getBeginDate());
         
          List dayevt =  (List) _evts.get(key);
          if (dayevt == null) {
            dayevt = new LinkedList();
            _evts.put(key, dayevt);
View Full Code Here

   */
  private void initDataListener() {
    if (_dataListener == null)
      _dataListener = new CalendarDataListener() {
        public void onChange(CalendarDataEvent event) {
          CalendarEvent ce = event.getCalendarEvent();
          if (ce == null) {  // if large scope change, such as clearAll
            reSendEventGroup();
            return;
          }
          switch (event.getType()) {
View Full Code Here

 
  public static CalendarsEvent getEditEvent(AuRequest request) {
    final JSONArray data = (JSONArray) request.getData().get("data");
    final Calendars cmp = verifyEvent(request, data, 5);
   
    CalendarEvent ce = cmp.getCalendarEventById(String.valueOf(data.get(0)));
   
    if (ce == null) return null;
   
    return new CalendarsEvent(ON_EVENT_EDIT, cmp, ce, null, null,
        getInt(data.get(1)), getInt(data.get(2)),
View Full Code Here

 
  public static CalendarsEvent getUpdateEvent(AuRequest request) {
    final JSONArray data = (JSONArray) request.getData().get("data");
    final Calendars cmp = verifyEvent(request, data, 7);
   
    CalendarEvent ce = cmp.getCalendarEventById(String.valueOf(data.get(0)));
   
    if (ce == null) return null;
    TimeZone tz = cmp.getDefaultTimeZone();
    Date eventBegin = Util.fixDSTTime(tz, new Date(getLong(data.get(1))));
    Date eventEnd = Util.fixDSTTime(tz, new Date(getLong(data.get(2))));
View Full Code Here

   
    TimeZone tz = calendars.getDefaultTimeZone();
   
    editEvent.setLeft(left + "px");
    editEvent.setTop(top + "px");
    CalendarEvent ce = evt.getCalendarEvent();
    SimpleDateFormat edit_sdf = new SimpleDateFormat("HH:mm");
    edit_sdf.setTimeZone(tz);
    Calendar calendar = Calendar.getInstance(org.zkoss.util.Locales
        .getCurrent());
    String[] times = edit_sdf.format(ce.getBeginDate()).split(":");
    int hours = Integer.parseInt(times[0]);
    int mins = Integer.parseInt(times[1]);
    int bdTimeSum = hours + mins;
    editEvent$ppbt.setSelectedIndex(hours*12 + mins/5);
    times = edit_sdf.format(ce.getEndDate()).split(":");
    hours = Integer.parseInt(times[0]);
    mins = Integer.parseInt(times[1]);
    int edTimeSum = hours + mins;
    editEvent$ppet.setSelectedIndex(hours*12 + mins/5);
    boolean isAllday = (bdTimeSum + edTimeSum) == 0;
    editEvent$ppbegin.setTimeZone(tz);
    editEvent$ppbegin.setValue(ce.getBeginDate());
    editEvent$ppend.setTimeZone(tz);
    editEvent$ppend.setValue(ce.getEndDate());
    editEvent$ppallDay.setChecked(isAllday);
    editEvent$pplocked.setChecked(ce.isLocked());
    editEvent$ppbt.setVisible(!isAllday);
    editEvent$ppet.setVisible(!isAllday);
    editEvent$ppcnt.setValue(ce.getContent());
    String colors = ce.getHeaderColor() + "," + ce.getContentColor();
    int index = 0;
    if ("#3467CE,#668CD9".equals(colors))
      index = 1;
    else if ("#0D7813,#4CB052".equals(colors))
      index = 2;
View Full Code Here

TOP

Related Classes of org.zkoss.calendar.api.CalendarEvent

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.