Пример #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
 private void initAddFilesButton() {
   // Add files button produces a dialog
   addFileButton =
       new PushButton(
           "",
           new ClickHandler() {
             @Override
             public void onClick(final ClickEvent event) {
               final int clientWidth = Window.getClientWidth();
               final int clientHeight = Window.getClientHeight();
               final int popupWidth = clientWidth * 3 / 4;
               final int popupHeight = clientHeight * 3 / 4;
               final int posX = (clientWidth - popupWidth) / 2;
               final int posY = (clientHeight - popupHeight) / 2;
               final FileTreeDialog dialog = new FileTreeDialog(popupWidth, popupHeight);
               dialog.setPopupPosition(posX, posY);
               dialog.setSelectedFilesListener(
                   new SelectedFilesListener() {
                     @Override
                     public void selectedFiles(final FileInfo[] info) {
                       files.addFiles(info);
                     }
                   });
               dialog.show();
             }
           });
   addFileButton.setEnabled(false);
   RootPanel.get("addFileButton").add(addFileButton);
 }
Пример #4
0
 private void loadCompleted() {
   // The load completed, enable buttons
   runButton.setEnabled(true);
   addFileButton.setEnabled(true);
 }