Package com.google.code.apis.rest.client.Util

Examples of com.google.code.apis.rest.client.Util.Uri


   *
   */
  private void updateParameterValue(String queryParameter, String queryValue) {
    TextBox requestUriTextBox = ReferenceManager.getRequestUriTextBox(requestString);
    String newRequestUriString = requestUriTextBox.getText();
    Uri uri = new Uri(newRequestUriString);
    String newUri = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath() + "?";
    String[] queryParameters = uri.getQueryParameters();
    String[] queryValues = uri.getQueryValues();
    for (int i = 0; i < queryParameters.length; i++) {
      if (i > 0) newUri += "&";           
      if (queryParameters[i].equals(queryParameter)) {             
        newUri += queryParameters[i] + "=" + queryValue;
      }
      else {
        newUri += queryParameters[i] + "=" + queryValues[i];
      }           
    } 
    newUri += uri.getFragment();
    updateReferences(requestUriTextBox, newUri);   
  }
View Full Code Here


  /**
   * Adds a parameter to the current request uri tree and in consequence to the request parameter tree.
   */
  public void addParam() {
    TextBox requestUriTextBox = ReferenceManager.getRequestUriTextBox(requestString);
    Uri uri = new Uri(requestUriTextBox.getText());   
    final HorizontalPanel containerPanel = new HorizontalPanel();
    final TreeItem parameterItem = new TreeItem(containerPanel);
    // parameter name textbox
    final TextBox queryParamNameTextBox = new TextBox();
    queryParamNameTextBox.setWidth("10em");
    // parameter value textbox
    final TextBox queryValueTextBox = new TextBox();
    queryValueTextBox.setWidth("10em");
    final String currentParameter = GuiFactory.strings.paramName();
    final String currentValue = GuiFactory.strings.paramValue();   
    String newUri = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath() + "?";
    String[] queryParameters = uri.getQueryParameters();
    String[] queryValues = uri.getQueryValues();
    for (int i = 0; i < queryParameters.length; i++) {
      if (i > 0) {
        newUri += "&";       
      }
      newUri += queryParameters[i] + "=" + queryValues[i];      
    }
    newUri += "&" + currentParameter + "=" + currentValue + uri.getFragment();
    updateReferences(requestUriTextBox, newUri);   
    queryParamNameTextBox.addKeyboardListener(new KeyboardListener() {
      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        // empty
      }
View Full Code Here

TOP

Related Classes of com.google.code.apis.rest.client.Util.Uri

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.