Package org.zkoss.calendar

Examples of org.zkoss.calendar.Calendars


  /** Creates an instance of {@link Event} based on the specified request.
   */
  public static CalendarsEvent getCreateEvent(AuRequest request) {
    final JSONArray data = (JSONArray) request.getData().get("data");
    final Calendars cmp = verifyEvent(request, data, 6);
    TimeZone tz = cmp.getDefaultTimeZone();
    Date eventBegin = Util.fixDSTTime(tz, new Date(getLong(data.get(0))));
    Date eventEnd = Util.fixDSTTime(tz, new Date(getLong(data.get(1))));
   
    return new CalendarsEvent(ON_EVENT_CREATE, cmp, null,
        eventBegin, eventEnd,
View Full Code Here


        getInt(data.get(4)),getInt(data.get(5)));
  }
 
  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

        getInt(data.get(3)), getInt(data.get(4)));
 
 
  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))));

    return new CalendarsEvent(ON_EVENT_UPDATE, cmp, ce,
        eventBegin, eventEnd,
View Full Code Here

        getInt(data.get(5)),getInt(data.get(6)));
  }
 
  public static Event getClickEvent(AuRequest request, String cmd) {
    final JSONArray data = (JSONArray) request.getData().get("data");
    final Calendars cmp = verifyEvent(request, data, 1);   
   
    return new Event(cmd, cmp, Util.fixDSTTime(cmp.getDefaultTimeZone(), new Date(getLong(data.get(0)))));
  }
View Full Code Here

  private static long getLong(Object obj){
    return Long.parseLong(String.valueOf(obj));
  }
 
  private static Calendars verifyEvent(AuRequest request, JSONArray data, int size) {
    final Calendars cmp = (Calendars)request.getComponent();
    if (cmp == null)
      throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, request);

    if (data == null || data.size() != size)
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
View Full Code Here

  /** Creates an instance of {@link Event} based on the specified request.
   */
  public static CalendarsEvent getCreateEvent(AuRequest request) {
    final JSONArray data = (JSONArray) request.getData().get("data");
    final Calendars cmp = verifyEvent(request, data, 6);
    TimeZone tz = cmp.getDefaultTimeZone();
    Date eventBegin = Util.fixDSTTime(tz, new Date(getLong(data.get(0))));
    Date eventEnd = Util.fixDSTTime(tz, new Date(getLong(data.get(1))));
   
    return new CalendarsEvent(ON_EVENT_CREATE, cmp, null,
        eventBegin, eventEnd,
View Full Code Here

        getInt(data.get(4)),getInt(data.get(5)));
  }
 
  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

        getInt(data.get(3)), getInt(data.get(4)));
 
 
  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))));

    return new CalendarsEvent(ON_EVENT_UPDATE, cmp, ce,
        eventBegin, eventEnd,
View Full Code Here

        getInt(data.get(5)),getInt(data.get(6)));
  }
 
  public static Event getClickEvent(AuRequest request, String cmd) {
    final JSONArray data = (JSONArray) request.getData().get("data");
    final Calendars cmp = verifyEvent(request, data, 1);   
   
    return new Event(cmd, cmp, Util.fixDSTTime(cmp.getDefaultTimeZone(), new Date(getLong(data.get(0)))));
  }
View Full Code Here

  private static long getLong(Object obj){
    return Long.parseLong(String.valueOf(obj));
  }
 
  private static Calendars verifyEvent(AuRequest request, JSONArray data, int size) {
    final Calendars cmp = (Calendars)request.getComponent();
    if (cmp == null)
      throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, request);

    if (data == null || data.size() != size)
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
View Full Code Here

TOP

Related Classes of org.zkoss.calendar.Calendars

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.