示例#1
0
  @Override
  protected void onAttach() {
    super.onAttach();
    Image img =
        new Image(
            getBaseImageUrl()
                + "?merchant_id="
                + getMerchantId()
                + "&w="
                + getWidth()
                + "&h="
                + getHeight()
                + "&style="
                + getStyle()
                + "&variant="
                + getVariant()
                + "&loc="
                + getLoc());
    img.setTitle("Fast checkout through Google");

    PushButton pb = new PushButton(img);
    pb.addClickHandler(this);
    vpanel.clear();
    vpanel.add(pb);
  }
示例#2
0
 private void initRunButton() {
   // Run Button ////////////////////////////////////////////
   runButton = new PushButton();
   RootPanel.get("runButton").add(runButton);
   runButton.setEnabled(false);
   runButton.addClickHandler(new RunClickHandler());
 }
示例#3
0
  /**
   * Builds a toolbar button.
   *
   * @param imageResource the button's icon
   * @param title the button's tooltip text
   * @param command the command to execute
   * @return a toolbar button
   */
  private Widget buildButton(ImageResource imageResource, String title, final Command command) {

    final PushButton btn = new PushButton(new Image(imageResource));
    btn.setTitle(title);
    btn.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            btn.setFocus(false);
            btn.removeStyleName("gwt-ToggleButton-up-hovering");
            command.execute();
          }
        });
    buttons.add(btn);
    return btn;
  }