Package org.zkoss.json

Examples of org.zkoss.json.JSONArray


  protected abstract List<Drawable> getDrawables();
 
  @SuppressWarnings("unchecked")
  @Override
  public JSONAware getShapeJSONObject() {
    JSONArray result = new JSONArray();
    for(Drawable d : getDrawables())
      result.add(d);
    return result;
  }
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,
        getInt(data.get(2)), getInt(data.get(3)),
        getInt(data.get(4)),getInt(data.get(5)));
  }
View Full Code Here

        getInt(data.get(2)), getInt(data.get(3)),
        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)),
        getInt(data.get(3)), getInt(data.get(4)));
 
View Full Code Here

        getInt(data.get(1)), getInt(data.get(2)),
        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,
        getInt(data.get(3)), getInt(data.get(4)),
        getInt(data.get(5)),getInt(data.get(6)));
  }
View Full Code Here

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

    return m;
  }
 
  private List createArrayContainer(ContainerFactory containerFactory){
    if(containerFactory == null)
      return new JSONArray();
    List l = containerFactory.creatArrayContainer();
   
    if(l == null)
      return new JSONArray();
    return l;
  }
View Full Code Here

   */
  public List getEncodedData() {
    if (_data == null)
      return null;

    final JSONArray encdata = new JSONArray();
    for (int j = 0; j < _data.length; ++j) {
      Object d = _data[j];
      if (d instanceof DeferredValue)
        d = ((DeferredValue)d).getValue();
      if (d instanceof Component)
        d = ((Component)d).getUuid();
      encdata.add(d);
    }
    return encdata;
  }
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,
        getInt(data.get(2)), getInt(data.get(3)),
        getInt(data.get(4)),getInt(data.get(5)));
  }
View Full Code Here

        getInt(data.get(2)), getInt(data.get(3)),
        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)),
        getInt(data.get(3)), getInt(data.get(4)));
 
View Full Code Here

        getInt(data.get(1)), getInt(data.get(2)),
        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,
        getInt(data.get(3)), getInt(data.get(4)),
        getInt(data.get(5)),getInt(data.get(6)));
  }
View Full Code Here

TOP

Related Classes of org.zkoss.json.JSONArray

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.