Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.Button


  public FormContents() {
      content = new FlexTable();
      content.setCellPadding(2);
      content.setWidth("500px");
      content.setStylePrimaryName("lab-Form");
      submit = new Button("OK");
      cancel = new Button("Cancel");
      buttonPanel = new HorizontalPanel();
      buttonPanel.setSpacing(10);
      buttonPanel.add(submit);
      buttonPanel.add(cancel);
    content.insertRow(0);
View Full Code Here


      "<li>Editor Preferences Dialog (Edit -> Preferences)</li>" +
      "<li>Code Splitting (on-demand loading of components)</li>" +
      "<li>Insert, Math and Format menus</li>" +
      "<li>Local MikTeX compiler support</li>" +
      "</ul>"));
    Button ok = new Button("OK", new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      hide();
    }
    });
View Full Code Here

      scroll = new ScrollPanel();
    tree = new ExplorerTree(true, true, true, null);
    tree.setSize("100%", "100%");
    tree.setExcludedOpen(true);
    scroll.add(tree);
    ok = new Button("OK", new ClickHandler(){
      public void onClick(ClickEvent event) {
        hide();
        if (selectionHandler != null) {
          ArrayList<DocumentServiceEntry> files = tree.getSelectedEntries();
          if (files.size() > 0) {
            selectionHandler.onSelection(new FileSelectionEvent(files.get(0)));
          }
        }
      }
    });
    cancel = new Button("Cancel", new ClickHandler() {
        public void onClick(ClickEvent event) {
          hide();
        }
      }
    );
View Full Code Here

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
    final Button sendButton = new Button("Send");
    final TextBox nameField = new TextBox();
    nameField.setText("GWT User");
    final Label errorLabel = new Label();

    // We can add style names to widgets
    sendButton.addStyleName("sendButton");

    // Add the nameField and sendButton to the RootPanel
    // Use RootPanel.get() to get the entire body element
    RootPanel.get("nameFieldContainer").add(nameField);
    RootPanel.get("sendButtonContainer").add(sendButton);
    RootPanel.get("errorLabelContainer").add(errorLabel);

    // Focus the cursor on the name field when the app loads
    nameField.setFocus(true);
    nameField.selectAll();

    // Create the popup dialog box
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Remote Procedure Call");
    dialogBox.setAnimationEnabled(true);
    final Button closeButton = new Button("Close");
    // We can set the id of a widget by accessing its Element
    closeButton.getElement().setId("closeButton");
    final Label textToServerLabel = new Label();
    final HTML serverResponseLabel = new HTML();
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.addStyleName("dialogVPanel");
    dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
    dialogVPanel.add(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
    dialogVPanel.add(serverResponseLabel);
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    // Add a handler to close the DialogBox
    closeButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        dialogBox.hide();
        sendButton.setEnabled(true);
        sendButton.setFocus(true);
      }
    });

    // Create a handler for the sendButton and nameField
    class MyHandler implements ClickHandler, KeyUpHandler {
      /**
       * Fired when the user clicks on the sendButton.
       */
      public void onClick(ClickEvent event) {
        sendNameToServer();
      }

      /**
       * Fired when the user types in the nameField.
       */
      public void onKeyUp(KeyUpEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          sendNameToServer();
        }
      }

      /**
       * Send the name from the nameField to the server and wait for a response.
       */
      private void sendNameToServer() {
        // First, we validate the input.
        errorLabel.setText("");
        String textToServer = nameField.getText();
        if (!FieldVerifier.isValidName(textToServer)) {
          errorLabel.setText("Please enter at least four characters");
          return;
        }

        // Then, we send the input to the server.
        sendButton.setEnabled(false);
        textToServerLabel.setText(textToServer);
        serverResponseLabel.setText("");
        greetingService.greetServer(textToServer,
            new AsyncCallback<String>() {
              public void onFailure(Throwable caught) {
                // Show the RPC error message to the user
                dialogBox
                    .setText("Remote Procedure Call - Failure");
                serverResponseLabel
                    .addStyleName("serverResponseLabelError");
                serverResponseLabel.setHTML(SERVER_ERROR);
                dialogBox.center();
                closeButton.setFocus(true);
              }

              public void onSuccess(String result) {
                dialogBox.setText("Remote Procedure Call");
                serverResponseLabel
                    .removeStyleName("serverResponseLabelError");
                serverResponseLabel.setHTML(result);
                dialogBox.center();
                closeButton.setFocus(true);
              }
            });
      }
    }

View Full Code Here

    // new wiki page
    newPanel = new Grid(2,2);
    newPanel.setWidget(0, 0, new HTML("Name:"));
    final TextBox name = new TextBox();
    newPanel.setWidget(0, 1, name);
    Button newButton = new Button("Erzeugen");
    newButton.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        String wikiPageName = name.getText();
        for (WikiPageBoxHandler handler: newHandler)
          handler.onWikiPage(wikiPageName);
        name.setText("");
      }
    });
    newPanel.setWidget(1, 1, newButton);
    panel.add(newPanel);
   
   
    // Auswaehlen
    selectPanel = new Grid(2,2);
    selectPanel.setWidget(0, 0, new HTML("Name"));
    selectBox = new ListBox();
    selectPanel.setWidget(0, 1, selectBox);
    Button selectButton = new Button("Auswählen");
    selectButton.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        String wikiPageName = selectBox.getItemText(selectBox.getSelectedIndex());
        for (WikiPageBoxHandler listener: selectHandler)
          listener.onWikiPage(wikiPageName);
      }
    });
    selectPanel.setWidget(1, 1, selectButton);
    selectPanel.setVisible(false);
    panel.add(selectPanel);
   
   
    // delete panel
    deletePanel = new Grid(2,2);
    deletePanel.setWidget(0, 0, new HTML("Name"));
    deleteBox = new ListBox();
    deletePanel.setWidget(0, 1, deleteBox);
    Button deleteButton = new Button("Löschen");
    deleteButton.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        String wikiPageName = deleteBox.getItemText(deleteBox.getSelectedIndex());
        for (WikiPageBoxHandler listener: deleteHandler)
View Full Code Here

    // Hilfe
    HTML help = new HTML(WIKI_HELP);
    footerPanel.add(help);
   
    // save button
    Button save = new Button("Seite speichern");
    save.setStyleName(STYLE_NAME_BUTTON);
    save.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        callback.toBeSaved(wikiPageArea.getText()new AsyncCallback<Boolean>() {
         
          @Override
          public void onSuccess(Boolean result) {
            if (result == null)
              Window.alert("Seite kann leider nicht gespeichert werden: unerwarteter Rückgabewert (result == null");
           
            if (result != null) {
              if (result)
                selectReadPanel();
              else
                Window.alert("Seite kann leider nicht gespeichert werden: unerwarteter Rückgabewert (result == false");
            }
          }
         

          @Override
          public void onFailure(Throwable caught) {
            Window.alert("Seite kann leider nicht gespeichert werden: caught.getMessage()");         
          }
        });
       
      }
    });
    footerPanel.add(save);
   
    // preview button
    Button preview = new Button("Vorschau anzeigen");
    preview.setStyleName(STYLE_NAME_BUTTON);
    preview.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        callback.toBePreview(wikiPageArea.getText()new AsyncCallback<Boolean>() {
         
          @Override
          public void onSuccess(Boolean result) {
            if (result == null)
              Window.alert("Vorschau auf Seite leider nicht möglich: unerwarteter Rückgabewert (result == null");
           
            if (result != null) {
              if (!result)
                Window.alert("Vorschau auf Seite leider nicht möglich: unerwarteter Rückgabewert (result == false");
            }
          }
         

          @Override
          public void onFailure(Throwable caught) {
            Window.alert("Vorschau auf Seite nicht möglich: caught.getMessage()");         
          }
        });
       
      }
       
    });
    footerPanel.add(preview);
   
    // discard button
    Button discard = new Button("Abbrechen");
    discard.setStyleName(STYLE_NAME_BUTTON);
    discard.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        try {
          if (!callback.discard())
          Window.alert("Änderung kann nicht zurückgenommen werden");
        } catch (Exception exception) {
          Window.alert("Änderung kann nicht zurückgenommen werden: " + exception.getMessage());
        }
      }
       
    });
    footerPanel.add(discard);
   
    // Create a FormPanel and point it at a service.
      final FormPanel form = new FormPanel();
      form.setAction("/image");

      // Because we're going to add a FileUpload widget, we'll need to set the
      // form to use the POST method, and multipart MIME encoding.
      form.setEncoding(FormPanel.ENCODING_MULTIPART);
      form.setMethod(FormPanel.METHOD_POST);

      // Create a panel to hold all of the form widgets.
      VerticalPanel panel = new VerticalPanel();
      form.setWidget(panel);

      // add label
      panel.add(new Label("select a file:"));
     
      // Create a FileUpload widget.
      final FileUpload upload = new FileUpload();
      upload.setName("uploadFormElement");
      panel.add(upload);

      // Add a 'submit' button.
      panel.add(new Button("Submit", new ClickHandler() {
        public void onClick(ClickEvent event) {
        upload.setName(upload.getFilename());
          form.submit();
        }
      }));
View Full Code Here

    dialogBox.setText("GPS Tagging Tolerance");
    VerticalPanel dialogVerticalPanel = new VerticalPanel();
    HTML dialogDesc = new HTML("GPS points are tagged based on nearness to user-defined roads. " +
        "The GPS tagging tolerance defines the maximum distance a point can be from a road and be included in the road's tag. " +
        "The system will use 1/2 of the block length that is set for the default zone type OR 50 m, whichever is greater.");
    Button ok = new Button("OK");
    ok.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        dialogBox.hide();
      }
View Full Code Here

        // "Please log in; leaving fields empty.");
        final Label namePrompt = new Label(c.Name());
        final TextBox nameTextbox = new TextBox();
        final Label passwordPrompt = new Label(c.Password());
        final PasswordTextBox passwordTextbox = new PasswordTextBox();
        final Button button = new Button(c.Login());

        nameTextbox.setEnabled(false);
        passwordTextbox.setEnabled(false);

        button.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                History.newItem(iCing.WELCOME_STATE);
            }
        });

        loginPrompt.addStyleName("loginPrompt");
        /**
         * nameTextbox.addStyleName("nameField"); passwordTextbox.addStyleName("passwordField");
         */
        grid.setWidget(0, 1, loginPrompt);
        grid.setWidget(1, 0, namePrompt);
        grid.setWidget(1, 1, nameTextbox);
        nameTextbox.setTitle(c.Short_name_like());

        grid.setWidget(2, 0, passwordPrompt);
        grid.setWidget(2, 1, passwordTextbox);
        passwordTextbox.setTitle(c.Short_secret_wo());

        grid.setWidget(3, 1, button);
        button.setTitle(c.Advance_to_file());
    }
View Full Code Here

        tabPanel.selectTab(0);

        final HorizontalPanel horizontalPanelBackNext = new HorizontalPanel();
        horizontalPanelBackNext.setSpacing(iCing.margin);
        verticalPanel.add(horizontalPanelBackNext);
        final Button backButton = new Button();
        final Button nextButton = new Button();
        horizontalPanelBackNext.add(backButton);
        backButton.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                icingShadow.onHistoryChanged(iCing.FILE_STATE);
                // History.back();
            }
        });
        backButton.setText(c.Back());
        horizontalPanelBackNext.add(backButton);
        horizontalPanelBackNext.add(nextButton);

        nextButton.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                icingShadow.onHistoryChanged(iCing.OPTIONS_STATE);
            }
        });
        nextButton.setText(c.Next());
        nextButton.setTitle(c.Set_the_options());

    }
View Full Code Here

    verticalPanel.add(reportHTML);

    final HorizontalPanel horizontalPanelBackNext = new HorizontalPanel();
    horizontalPanelBackNext.setSpacing(iCing.margin);
    verticalPanel.add(horizontalPanelBackNext);
    final Button backButton = new Button();
    horizontalPanelBackNext.add(backButton);
    backButton.addClickListener(new ClickListener() {
      public void onClick(final Widget sender) {
        icingShadow.onHistoryChanged(iCing.CING_LOG_STATE);
        // History.back();
      }
    });
    backButton.setText(c.Back());
    horizontalPanelBackNext.add(backButton);
    // horizontalPanelBackNext.add(nextButton);

    final HorizontalPanel horizontalPanelBackPurge = new HorizontalPanel();
    horizontalPanelBackPurge.setSpacing(iCing.margin);
    verticalPanel.add(horizontalPanelBackPurge);
    final Button purgeButton = new Button();
    horizontalPanelBackPurge.add(purgeButton);
    purgeButton.addClickListener(new ClickListener() {
      public void onClick(final Widget sender) {
        icingShadow.cingLogView.getPurgeProject();
      }
    });
    purgeButton.setText(c.PurgeProject());
    purgeButton.setTitle(c.PurgeProjectTitl());
    horizontalPanelBackPurge.add(purgeButton);

    showTemporaryResults();
    // refreshShowResultsTimer = new Timer() {
    // public void run() {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.Button

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.