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

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


public class LoginPanel extends PopupPanel {
  private VerticalPanel loginPanel = new VerticalPanel();
  private Label loginLabel = new Label("Please login with your Facebook ID");
  public LoginPanel(){   
        loginPanel.add(loginLabel);
        final Button loginButton = new Button("Login");
          loginButton.setPixelSize(100, 35);
          loginButton.setStylePrimaryName("button");
          loginPanel.add(loginButton);
       this.setGlassEnabled(true);
       this.setAnimationEnabled(true);
       this.setWidget(loginPanel);
  }
View Full Code Here


         popupPanel.setGlassEnabled(true);
         popupPanel.setAnimationEnabled(true);
         final VerticalPanel vertPanel = new VerticalPanel();
         final Label userLabel = new Label();
         userLabel.setText("Please login with your Facebook ID");
         final Button loginButton = new Button("Login");
         loginButton.setPixelSize(100, 35);
         loginButton.setStylePrimaryName("button");
       
         loginButton.addClickHandler(new ClickHandler() {
             @Override
             public void onClick(ClickEvent event) {              
               fbCore.getLoginStatus(new loginStatusCallback());
               popupPanel.hide();
             }
View Full Code Here

             HTML likeHTML=new HTML();
             likeHTML.setHTML("<iframe src=\"https://www.facebook.com/plugins/like.php?href=http://10.socialgamescourse.appspot.com/\" scrolling=\"no\" frameborder=\"0\"style=\"border:none; width:260px; height:25px\"></iframe>");     
             VerticalPanel likePanel= new VerticalPanel();
             likePanel.add(likeHTML);
             footer.add(likePanel);
             Button logout = new Button("logout");
             logout.setPixelSize(65,25);
             logout.setStylePrimaryName("button");
             footer.add(logout);
             logout.addClickHandler(new ClickHandler(){
                 @Override
                 public void onClick(ClickEvent event){
                         fbCore.logout(new logoutCallback());
                 }
             });
View Full Code Here

              m.openInfoWindow("Hello");
            }
          });
          view.getChart().getPlot().addOverlay(m);
          view.getChart().getPlot().redraw();
          Button bench = new Button("Bench");
          RootPanel.get().add(bench);
          bench.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
              benchMark(view);
            }
          });
View Full Code Here

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
    final Button sendButton = new Button("Send to Havlak");
    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("Loop Recognition");
    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(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Algorithm 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();

        //=======================================================
        // HAVLAK
        //=======================================================
        long start = System.currentTimeMillis();
        String result = "Welcome to LoopTesterApp, GWT edition<br>";
        LoopTesterApp app = new LoopTesterApp();
        app.cfg.createNode(0);
        app.lsg.dump();
        app.buildBaseLoop(0);
        app.cfg.createNode(1);
        new BasicBlockEdge(app.cfg, 0, 2);
        int found = 0;

        result += "15000 dummy loops<br>";
        serverResponseLabel.setHTML(result);
        for (int dummyloop = 0; dummyloop < 1; dummyloop++) {
          HavlakLoopFinder finder = new HavlakLoopFinder(app.cfg, app.lsg);
          finder.findLoops();
        }

        result += "Constructing CFG...<br>";
        serverResponseLabel.setHTML(result);
        int n = 2;

        for (int parlooptrees = 0; parlooptrees < 10; parlooptrees++) {
          app.cfg.createNode(n + 1);
          app.buildConnect(2, n + 1);
          n = n + 1;

          for (int i = 0; i < 2; i++) {
            int top = n;
            n = app.buildStraight(n, 1);
            for (int j = 0; j < 25; j++) {
              n = app.buildBaseLoop(n);
            }
            int bottom = app.buildStraight(n, 1);
            app.buildConnect(n, top);
            n = bottom;
          }
          app.buildConnect(n, 1);
        }

        result += "Performing Loop Recognition\n1 Iteration<br>";
        HavlakLoopFinder finder = new HavlakLoopFinder(app.cfg, app.lsg);
        finder.findLoops();
        long t = System.currentTimeMillis() - start;
        result += "Found: " + app.lsg.getNumLoops() + " in " +
            t + " [ms]";

        result += "Another 100 iterations...<br>";
        for (int i = 0; i < 100; i++) {
          HavlakLoopFinder finder2 = new HavlakLoopFinder(app.cfg, new LSG());
          finder2.findLoops();
        }
        t = System.currentTimeMillis() - start;
        result += "<br>Found: " + app.lsg.getNumLoops() + " in " +
            t + " [ms]";

        //=======================================================

        sendButton.setEnabled(false);
        dialogBox.setText("Find Loops");
        serverResponseLabel.setHTML(result);
        dialogBox.center();
        closeButton.setFocus(true);

        /*
        //        if (!FieldVerifier.isValidName(textToServer)) {
        //          errorLabel.setText("Please enter at least four characters");
        //          return;
View Full Code Here

    box.setText(title);
    box.setWidth("200px"); // It's an higherlower, folks!

    VerticalPanel verticalPanel = new VerticalPanel();

    Button higher = new Button("Higher, higher!");
    higher.addStyleName("centered");
    higher.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        box.hide();
        gameHost.get().playerGuess(RelationshipToPreviousCard.HIGHER);
      }
    });
    verticalPanel.add(higher);

    Button lower = new Button("Down, boy!");
    lower.addStyleName("centered");
    lower.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        box.hide();
        gameHost.get().playerGuess(RelationshipToPreviousCard.LOWER);
      }
    });
View Full Code Here

  public void showEndGame(final Runnable runnable) {
    final DialogBox box = new DialogBox();
    box.setAnimationEnabled(true);
    box.setText("Thanks for playing Higher or Lower! *ding*ding*ding*ding*");
    Button b = new Button("Thanks for having me!");
    b.addStyleName("centered");
    b.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        runnable.run();
        box.hide();
      }
    });
View Full Code Here

import com.google.gwt.user.client.ui.Button;
import com.google.inject.Provider;

public class StartGameButtonProvider implements Provider<Button> {
  public Button get() {
    return new Button("Start Game");
  }
View Full Code Here

    this.asyncWidgetProvider = asyncWidgetProvider;
   
    text = new Label();
    text.addStyleName("message");

    Button showMessage = new Button(constants.showMessage(), new ClickHandler() {
      public void onClick(ClickEvent event) {
        showMessage();
      }
    });

    Button showError = new Button(constants.showError(), new ClickHandler() {
      public void onClick(ClickEvent event) {
        showError();
      }
    });

    Button showAsync = new Button(constants.showMessageForAsync(), new ClickHandler() {
      public void onClick(ClickEvent event) {
        showAsync();
      }
    });
   
View Full Code Here

    DockPanel p = new DockPanel();
    p.setWidth("100%");

    HorizontalPanel buttonPanel = new HorizontalPanel();

    Button addButton = new Button("Draw new object");
    addButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (addPolyDialog == null) {
          addPolyDialog = makeAddPolyDialog();
        }
        addPolyDialog.center();
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.