Package org.eclipse.rap.rwt.internal.theme

Examples of org.eclipse.rap.rwt.internal.theme.JsonObject


  }

  @Override
  protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException {
    Collection<String> servletPaths = manager.getServletPaths();
    JsonObject jsonObject = createMessageObject( servletPaths );
    resp.setContentType( "application/json" );
    resp.getWriter().write( jsonObject.toString() );
  }
View Full Code Here


    resp.setContentType( "application/json" );
    resp.getWriter().write( jsonObject.toString() );
  }

  private JsonObject createMessageObject( Collection<String> servletPaths ) {
    JsonObject jsonObject = new JsonObject();
    JsonArray array = new JsonArray();
    appendPaths( servletPaths, array );
    jsonObject.append( KEY_ENTRYPOINTS, array );
    return jsonObject;
  }
View Full Code Here

    return jsonObject;
  }

  private void appendPaths( Collection<String> servletPaths, JsonArray array ) {
    for( String path : servletPaths ) {
      JsonObject object = new JsonObject();
      object.append( KEY_PATH, path );
      array.append( object );
    }
  }
View Full Code Here

    return null;
  }

  private InputStream getEntryPoints() {
    Collection<String> servletPaths = entryPointManager.getServletPaths();
    JsonObject jsonObject = createMessageObject( servletPaths );
    String json = jsonObject.toString();
    try {
      return new ByteArrayInputStream( json.getBytes( "utf-8" ) );
    } catch( UnsupportedEncodingException uee ) {
      throw new IllegalStateException( uee );
    }
View Full Code Here

      throw new IllegalStateException( uee );
    }
  }

  private JsonObject createMessageObject( Collection<String> servletPaths ) {
    JsonObject jsonObject = new JsonObject();
    JsonArray array = new JsonArray();
    appendPaths( ( List<String> )servletPaths, array );
    jsonObject.append( KEY_ENTRYPOINTS, array );
    return jsonObject;
  }
View Full Code Here

  }

  private void appendPaths( List<String> servletPaths, JsonArray array ) {
    Collections.sort( servletPaths );
    for( String path : servletPaths ) {
      JsonObject object = new JsonObject();
      object.append( KEY_PATH, ".." + path );
      array.append( object );
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.rap.rwt.internal.theme.JsonObject

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.