Package com.google.wave.api

Examples of com.google.wave.api.FormElement


   *
   * @return true if the button was clicked, false otherwise.
   */
  public boolean isSubmitPollButtonPressed() {
    FormView formView = blip.getDocument().getFormView();
    FormElement submitPoll = formView.getFormElement(PREV_SUBMIT_POLL_BUTTON);
   
    boolean isPressed = "clicked".equals(submitPoll.getValue());
    if (isPressed) {
      submitPoll.setValue(submitPoll.getDefaultValue());
      formView.replace(submitPoll);
    }
   
    return isPressed;
  }
View Full Code Here


    Type mapType = new TypeToken<Map<String, String>>(){}.getType();
    Map<String, String> properties = context.deserialize(
        json.getAsJsonObject().get(PROPERTIES_TAG), mapType);

    if (FormElement.getFormElementTypes().contains(type)) {
      result = new FormElement(type, properties);
    } else if (type == ElementType.GADGET) {
      result = new Gadget(properties);
    } else if (type == ElementType.IMAGE) {
      result = new Image(properties);
    } else if (type == ElementType.LINE) {
View Full Code Here

    }
    return null;
  }

  private void appendInput(Blip blip, String name, String value) {
    FormElement input = new FormElement(ElementType.INPUT);
    input.setDefaultValue(value);
    input.setValue(value);
    input.setName(name);
    blip.append(input);
  }
View Full Code Here

    input.setName(name);
    blip.append(input);
  }

  private void appendButton(Blip blip, String name, String value) {
    FormElement button = new FormElement(ElementType.BUTTON);
    button.setDefaultValue(value);
    button.setValue(value);
    button.setName(name);
    blip.append(button);
  }
View Full Code Here

      }     
    }       
  }
 
  private void addButton(Blip blip) {
    FormElement button = new FormElement();
    button.setType(ElementType.BUTTON);
    button.setName("my_button");
    button.setValue("click me");   
    blip.getDocument().getFormView().append(button);   
  }
View Full Code Here

    // Set the new title.
    blip.getWavelet().setTitle(new StyledText("Twitter Search", StyleType.HEADING3));

    // Insert the search input box.
    document.append("\n");
    document.appendElement(new FormElement(
        ElementType.INPUT,
        SEARCH_INPUT_ID,
        twitterWave.getSearchQuery()));

    // Append the search button.
    document.append("\n");
    document.appendElement(new FormElement(
        ElementType.BUTTON,
        SEARCH_BUTTON_ID,
        SEARCH_BUTTON_CAPTION));
  }
View Full Code Here

        new StyledText("What are you doing ?",
            StyleType.HEADING3));

    // Insert the update form.
    document.append("\n");
    document.appendElement(new FormElement(
        ElementType.INPUT,
        UPDATE_INPUT_ID,
        ""));

    // Insert the update button.
    document.append("\n");
    document.appendElement(new FormElement(
        ElementType.BUTTON,
        UPDATE_BUTTON_ID,
        "Update"));
  }
View Full Code Here

    // explicitly through the active gateway, or, as in this case, submit it
    // together with wavelet, which will handle the submit automatically.
    newWave.submitWith(wavelet);

    // Test inserting a form element.
    blip.append(new FormElement(ElementType.CHECK, "My Label", "true", "false"));

    // Test inserting replies with image.
    String imgUrl = "http://upload.wikimedia.org/wikipedia/en/thumb/c/cc/Googlewave.svg/" +
        "200px-Googlewave.svg.png";
    Blip replyBlip = blip.reply();
View Full Code Here

    contentsDocument.append("\n\n(Write Introduction Here)");
   
    // Create New Post button in new blip.
    Blip blip = wavelet.appendBlip();
    contentsDocument = blip.getDocument();
    contentsDocument.appendElement(new FormElement(ElementType.BUTTON, LOGIN_BUTTON_ID,
        LOGIN_BUTTON_CAPTION));
   
    // Create new blip for TOC and save blip ID.
    String blipKey = String.valueOf(Math.random());
    blip = wavelet.appendBlip(blipKey);
View Full Code Here

    int startIndex = b.length();
    b.append(LOGIN_LINK_TEXT + "\n\n");
    wavelet.getRootBlip().append(b.toString());

    // Add button to click when authentication is complete.
    wavelet.getRootBlip().append(new FormElement(ElementType.BUTTON, LOGIN_BUTTON_ID,
        LOGIN_BUTTON_CAPTION));

    // Linkify the authorization link.
    wavelet.getRootBlip().range(startIndex, startIndex + LOGIN_LINK_TEXT.length()).annotate(
        LINK_ANNOTATION_KEY, url);
View Full Code Here

TOP

Related Classes of com.google.wave.api.FormElement

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.