Package org.richfaces.json

Examples of org.richfaces.json.JSONMap$MyAbstractSet


            String s = (String) value;
            if (!s.startsWith("{")) {
                s = "{" + s + "}";
            }
            try {
                return new HashMap<String, Object>(new JSONMap(s));
            } catch (JSONException e) {
                throw new FacesException(e);
            }
        } else {
            throw new FacesException("Attribute visualOptions of component ["
View Full Code Here


      addOption("acceptedTypes", acceptedTypes);

      Object typeMapping = zone.getTypeMapping();
      if(typeMapping instanceof String) {
        try {
          typeMapping = new JSONMap((String)typeMapping);
        } catch (JSONException e) {
          throw new FacesException(e);
        }
      }
      addOption("typeMapping", typeMapping);
     
      Object cursorTypeMapping = zone.getCursorTypeMapping();
      if (cursorTypeMapping instanceof String) {
        try {
          cursorTypeMapping = new JSONMap((String)cursorTypeMapping);
        } catch (JSONException e) {
          throw new FacesException(e)
        }
      }
     
View Full Code Here

      String s = (String) value;
      if (!s.startsWith("{")) {
        s = "{" + s + "}";
      }
      try {
        return new HashMap<String, Object>(new JSONMap(s));
      } catch (JSONException e) {
        throw new FacesException(e);
      }
    } else {
      throw new FacesException("Attribute visualOptions of component [" +
View Full Code Here

      addOption("acceptedTypes", acceptedTypes);

      Object typeMapping = zone.getTypeMapping();
      if(typeMapping instanceof String) {
        try {
          typeMapping = new JSONMap((String)typeMapping);
        } catch (JSONException e) {
          throw new FacesException(e);
        }
      }
      addOption("typeMapping", typeMapping);
     
      Object cursorTypeMapping = zone.getCursorTypeMapping();
      if (cursorTypeMapping instanceof String) {
        try {
          cursorTypeMapping = new JSONMap((String)cursorTypeMapping);
        } catch (JSONException e) {
          throw new FacesException(e)
        }
      }
     
View Full Code Here

      addOption("acceptedTypes", acceptedTypes);

      Object typeMapping = zone.getTypeMapping();
      if(typeMapping instanceof String) {
        try {
          typeMapping = new JSONMap((String)typeMapping);
        } catch (JSONException e) {
          throw new FacesException(e);
        }
      }
      addOption("typeMapping", typeMapping);
     
      Object cursorTypeMapping = zone.getCursorTypeMapping();
      if (cursorTypeMapping instanceof String) {
        try {
          cursorTypeMapping = new JSONMap((String)cursorTypeMapping);
        } catch (JSONException e) {
          throw new FacesException(e)
        }
      }
     
View Full Code Here

   * Converts its state based on table attribute value or create default state if it is not set.
   */
  protected void init(UIExtendedDataTable extendedDataTable){
    //get state value from components attribute
    String value = extendedDataTable.getTableState();
    JSONMap stateMap = null;
    if ((value != null) && (value.length() > 0)){
      try {
        stateMap = new JSONMap(value);
      } catch (JSONException e) {
        e.printStackTrace();
      }
    }
    //initialize columns order part
    try{
      columnsOrder = ColumnsOrder.getColumnsOrder(extendedDataTable, (stateMap == null ? null : (JSONCollection)stateMap.get("columnsOrder")));
    }
    catch(Exception e){
      columnsOrder = ColumnsOrder.getColumnsOrder(extendedDataTable, (JSONCollection)null);
    }
    //initialize columns visibility part
    try{
      columnsVisibility = ColumnsVisibility.getColumnsVisibility(extendedDataTable, (stateMap == null ? null : (JSONMap)stateMap.get("columnsVisibility")));
    }
    catch(Exception e){
      columnsVisibility = ColumnsVisibility.getColumnsVisibility(extendedDataTable, (JSONMap)null);
    }
    //initialize columns size part
    try{
      columnsSizeState = ColumnsSizeState.getColumnsSize(extendedDataTable, (stateMap == null ? null : (JSONMap)stateMap.get("columnsSizeState")));
    }
    catch(Exception e){
      columnsSizeState = ColumnsSizeState.getColumnsSize(extendedDataTable, (JSONMap)null);
    }
    //initialize column grouping part
    try{
      columnGroupingState = ColumnGroupingState.getColumnGropingState(extendedDataTable, (stateMap == null ? null : (JSONMap)stateMap.get("columnGroupingState")));
    }
    catch(Exception e){
      columnGroupingState = ColumnGroupingState.getColumnGropingState(extendedDataTable, (JSONMap)null);
    }
  }//init 
View Full Code Here

  /**
   * Get state in JSON format.
   * @return JSON object contains state
   */
  public JSONMap toJSON(){
    return new JSONMap(value);
  }
View Full Code Here

    super();
  }
 
  static ColumnsVisibility getColumnsVisibility(UIExtendedDataTable extendedDataTable, String val) throws JSONException{
    ColumnsVisibility columnsVisibility = new ColumnsVisibility();
    columnsVisibility.init(extendedDataTable, new JSONMap(val));
    return columnsVisibility;
  }
View Full Code Here

  /**
   * Get state in JSON format.
   * @return JSON object contains state
   */
  public JSONMap toJSON(){
    return new JSONMap(value);
  }
View Full Code Here

      String s = (String) value;
      if (!s.startsWith("{")) {
        s = "{" + s + "}";
      }
      try {
        return new HashMap<String, Object>(new JSONMap(s));
      } catch (JSONException e) {
        throw new FacesException(e);
      }
    } else {
      throw new FacesException("Attribute visualOptions of component [" +
View Full Code Here

TOP

Related Classes of org.richfaces.json.JSONMap$MyAbstractSet

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.