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

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


      cellFormatter.setColSpan(0, 0, 2);
      cellFormatter.setHorizontalAlignment(0, 0,
          HasHorizontalAlignment.ALIGN_CENTER);
  */
      // Add some standard form options
      final TextBox userBox = new TextBox();
      userBox.setText("imdev");
      layout.setHTML(0, 0, constants.user());
      layout.setWidget(0, 1, userBox);
      final PasswordTextBox  passBox = new PasswordTextBox ();
      passBox.setText("imdev631");
     
      layout.setHTML(1, 0, constants.password());
      layout.setWidget(1, 1, passBox);

      // Create some advanced options
      Grid advancedOptions = new Grid(5, 2);
      advancedOptions.setCellSpacing(6);
     
      final TextBox hostBox = new TextBox();
      final TextBox portBox = new TextBox();
      final TextBox domainBox = new TextBox();
      final CheckBox authCheck = new CheckBox("SASL");
      authCheck.setChecked(false);
     
      hostBox.setEnabled(false);
    portBox.setEnabled(false);
    domainBox.setEnabled(false);
    authCheck.setEnabled(false);
           
      final CheckBox serverConfig = new CheckBox(constants.defineServerConfig());
      advancedOptions.setWidget(0, 0, serverConfig);
      serverConfig.addClickListener(new ClickListener()
      {
      public void onClick(Widget sender) {
        if(serverConfig.isChecked())
        {
          hostBox.setEnabled(true);
          portBox.setEnabled(true);
          domainBox.setEnabled(true);
          authCheck.setEnabled(true);
        }
        else
        {
          hostBox.setEnabled(false);
          portBox.setEnabled(false);
          domainBox.setEnabled(false);
          authCheck.setEnabled(false);
        }
       
      }
       
      });
     
      serverConfig.setChecked(false);
     
      advancedOptions.setHTML(1, 0, constants.domain());
      advancedOptions.setWidget(1, 1, hostBox);
     
      advancedOptions.setHTML(2, 0, constants.host());
      advancedOptions.setWidget(2, 1, portBox);
     
      advancedOptions.setHTML(3, 0, constants.port());
      advancedOptions.setWidget(3, 1, domainBox);
     
      advancedOptions.setWidget(4, 0, authCheck);

      // Add advanced options to form in a disclosure panel
      DisclosurePanel advancedDisclosure = new DisclosurePanel(
          constants.moreOptions());
      advancedDisclosure.setAnimationEnabled(true);
      advancedDisclosure.ensureDebugId("cwDisclosurePanel");
      advancedDisclosure.setContent(advancedOptions);
      layout.setWidget(2, 0, advancedDisclosure);
     
      Button loginButton = new Button(constants.login());
     
      layout.setWidget(3, 0,loginButton);
      loginButton.addSelectionListener(new SelectionListener<ButtonEvent>()
      {
      public void componentSelected(ButtonEvent ce)
      {
        String user = userBox.getText();
          String pass = passBox.getText();
          String domain = domainBox.getText();
          String host = domainBox.getText();
          boolean sasl = authCheck.isChecked();
          if(serverConfig.isChecked())
          {
            int port = Integer.parseInt(portBox.getText());
            //JabberApp.instance().onLogin(host, port, domain, sasl, user, pass);
View Full Code Here


    
    statusLabel = new Label();
    statusLabel.setStyleName("status_label");
    statusLabel.setWidth("100%");

    statusEditor = new TextBox();
    statusEditor.setVisible(false);
    statusEditor.setWidth("100%");

    statusButton = new Button();
    statusButton.setMenu(statusMenu);
View Full Code Here

    userName.setFocus(true);
    return panel;
  }
 
  private void createUsernameAndPasswordTextBoxes() {
    userName = new TextBox();
    userName.setWidth("200");
    userPassword = new PasswordTextBox();
    userPassword.setWidth("200");
   
    UserInfo userInfo = CookieMan.getUserInfo();
View Full Code Here

        setTitle(c.Login());

        final Label loginPrompt = new Label(c.Please_log_in());
        // "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());

View Full Code Here

        noneWiCheckBox = new CheckBox();
        wiTable.setWidget(rowIdxWiNone, 0, noneWiCheckBox);
        wiTable.getCellFormatter().setHorizontalAlignment(rowIdxWiNone, 0, HasHorizontalAlignment.ALIGN_CENTER);
        wiTable.getFlexCellFormatter().setColSpan(rowIdxWiNone, 0, 5);
        noneWiCheckBox.setText(c.none());
        ramaTextBoxBad = new TextBox();
        wiTable.setWidget(rowIdxWiRama, 2, ramaTextBoxBad);
        wiTable.getCellFormatter().setHorizontalAlignment(rowIdxWiRama, 2, HasHorizontalAlignment.ALIGN_CENTER);
        ramaTextBoxBad.setStyleName("red");
        ramaTextBoxBad.setText(CRV_WI_BAD_RAMCHK);
        ramaTextBoxBad.setWidth("3em");
        ramaTextBoxPoor = new TextBox();
        wiTable.setWidget(rowIdxWiRama, 3, ramaTextBoxPoor);
        wiTable.getCellFormatter().setHorizontalAlignment(rowIdxWiRama, 3, HasHorizontalAlignment.ALIGN_CENTER);
        ramaTextBoxPoor.setStyleName("orange");
        ramaTextBoxPoor.setText(CRV_WI_POOR_RAMCHK);
        ramaTextBoxPoor.setWidth("3em");

        bbTextBoxBad = new TextBox();
        wiTable.setWidget(rowIdxWiBb, 2, bbTextBoxBad);
        wiTable.getCellFormatter().setHorizontalAlignment(rowIdxWiBb, 2, HasHorizontalAlignment.ALIGN_RIGHT);
        bbTextBoxBad.setText(CRV_WI_BAD_BBCCHK);
        bbTextBoxBad.setStyleName("red");
        bbTextBoxBad.setWidth("3em");

        bbTextBoxPoor = new TextBox();
        wiTable.setWidget(rowIdxWiBb, 3, bbTextBoxPoor);
        wiTable.getCellFormatter().setHorizontalAlignment(rowIdxWiBb, 3, HasHorizontalAlignment.ALIGN_CENTER);
        bbTextBoxPoor.setText(CRV_WI_POOR_BBCCHK);
        bbTextBoxPoor.setStyleName("orange");
        bbTextBoxPoor.setWidth("3em");

        ramachandranPlotCheckBox = new CheckBox();
        wiTable.setWidget(rowIdxWiRama, 0, ramachandranPlotCheckBox);
        ramachandranPlotCheckBox.setChecked(true);
        ramachandranPlotCheckBox.setText("Ramachandran " + c.plot());
        ramachandranPlotCheckBox.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                Utils.setEnabledAllInColumnsButFirst(wiTable, rowIdxWiRama, ramachandranPlotCheckBox.isChecked());
            }
        });

        janinPlotCheckBox = new CheckBox();
        wiTable.setWidget(rowIdxWiJanin, 0, janinPlotCheckBox);
        janinPlotCheckBox.setChecked(true);
        janinPlotCheckBox.setText("Janin " + c.plot());
        janinPlotCheckBox.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                Utils.setEnabledAllInColumnsButFirst(wiTable, rowIdxWiJanin, janinPlotCheckBox.isChecked());
            }
        });

        janinTextBoxBad = new TextBox();
        wiTable.setWidget(rowIdxWiJanin, 2, janinTextBoxBad);
        wiTable.getCellFormatter().setHorizontalAlignment(rowIdxWiJanin, 2, HasHorizontalAlignment.ALIGN_CENTER);
        janinTextBoxBad.setText(CRV_WI_BAD_C12CHK);
        janinTextBoxBad.setStyleName("red");
        janinTextBoxBad.setWidth("3em");

        final Label residueSigmas22Label = new Label(c.residue_sigma() + " [-2,2]");
        wiTable.setWidget(rowIdxWiRama, 4, residueSigmas22Label);

        final Label occurancesInDbLabel = new Label(c.occurrences_in() + " [0-80]");
        wiTable.setWidget(rowIdxWiBb, 4, occurancesInDbLabel);

        backboneNormalityCheckBox = new CheckBox();
        wiTable.setWidget(rowIdxWiBb, 0, backboneNormalityCheckBox);
        backboneNormalityCheckBox.setChecked(false);
        backboneNormalityCheckBox.setText(c.Backbone_norm());
        backboneNormalityCheckBox.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                Utils.setEnabledAllInColumnsButFirst(wiTable, rowIdxWiBb, backboneNormalityCheckBox.isChecked());
            }
        });
        // Disable the boxes markup.
        Utils.setEnabledAllInColumnsButFirst(wiTable, rowIdxWiBb, backboneNormalityCheckBox.isChecked());
//        backboneNormalityCheckBox.fireEvent(event) this would enable the

        janinTextBoxPoor = new TextBox();
        wiTable.setWidget(rowIdxWiJanin, 3, janinTextBoxPoor);
        wiTable.getCellFormatter().setHorizontalAlignment(3, 3, HasHorizontalAlignment.ALIGN_CENTER);
        janinTextBoxPoor.setStyleName("orange");
        janinTextBoxPoor.setText(CRV_WI_POOR_C12CHK);
        janinTextBoxPoor.setWidth("3em");

        final Label residueSigmas22Label_1 = new Label(c.residue_sigma() + " [-2,2]");
        wiTable.setWidget(rowIdxWiJanin, 4, residueSigmas22Label_1);

        final FlexTable pcTable = new FlexTable();
        pcTable.setTitle("ProcheckNMR/Aqua");
        tabPanel.add(pcTable, "ProcheckNMR/Aqua", true);

        nonePcCheckBox = new CheckBox();
        pcTable.setWidget(rowIdxPcNone, 0, nonePcCheckBox);
        pcTable.getCellFormatter().setHorizontalAlignment(rowIdxPcNone, 0, HasHorizontalAlignment.ALIGN_CENTER);
        pcTable.getFlexCellFormatter().setColSpan(rowIdxPcNone, 0, 4);

        // PC G factor row
        textBoxGfactorPoor = new TextBox();
        pcTable.setWidget(rowIdxPcGfactor, 2, textBoxGfactorPoor);
        textBoxGfactorPoor.setStyleName("orange");
        textBoxGfactorPoor.setText(CRV_PC_POOR_GF);
        textBoxGfactorPoor.setWidth("3em");
        textBoxGfactorBad = new TextBox();
        pcTable.setWidget(rowIdxPcGfactor, 1, textBoxGfactorBad);
        pcTable.getCellFormatter().setHorizontalAlignment(rowIdxPcGfactor, 3, HasHorizontalAlignment.ALIGN_LEFT);
        textBoxGfactorBad.setStylePrimaryName("red");
        textBoxGfactorBad.setText(CRV_PC_BAD_GF);
        textBoxGfactorBad.setWidth("3em");
        @SuppressWarnings("unused")
        final Label gFactorLimitsLabel = new Label("[-99,99]");
        // pcTable.setWidget(rowIdxPcGfactor, 3, gFactorLimitsLabel);
        includeIntraresidualContactsCheckBox = new CheckBox();
        pcTable.setWidget(rowIdxPcIntra, 0, includeIntraresidualContactsCheckBox);
        includeIntraresidualContactsCheckBox.setChecked(true);
        includeIntraresidualContactsCheckBox.setText(c.Include_intra());

        noeCompletenessCheckBox = new CheckBox();
        pcTable.setWidget(rowIdxPcComple, 0, noeCompletenessCheckBox);
        noeCompletenessCheckBox.setChecked(true);
        noeCompletenessCheckBox.setText(c.NOE_completen() + " " + c.per_residue());
        noeCompletenessCheckBox.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                Utils.setEnabledAllInColumnsButFirst(pcTable, rowIdxPcComple, noeCompletenessCheckBox.isChecked());
            }
        });
        gFactorCheckBox = new CheckBox();
        pcTable.setWidget(rowIdxPcGfactor, 0, gFactorCheckBox);
        gFactorCheckBox.setChecked(true);
        gFactorCheckBox.setText(c.gFactor());
        gFactorCheckBox.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                Utils.setEnabledAllInColumnsButFirst(pcTable, rowIdxPcGfactor, gFactorCheckBox.isChecked());
            }
        });

        textBoxComplBad = new TextBox();
        pcTable.setWidget(rowIdxPcComple, 1, textBoxComplBad);
        textBoxComplBad.setVisibleLength(3);
        textBoxComplBad.setMaxLength(3);
        textBoxComplBad.setStyleName("red");
        textBoxComplBad.setText(CRV_AQUA_COMPL_BAD);
        textBoxComplBad.setWidth("3em");

        textBoxComplPoor = new TextBox();
        pcTable.setWidget(rowIdxPcComple, 2, textBoxComplPoor);
        textBoxComplPoor.setVisibleLength(3);
        textBoxComplPoor.setStyleName("orange");
        textBoxComplPoor.setText(CRV_AQUA_COMPL_POOR);
        textBoxComplPoor.setWidth("3em");
        final Label per0100Label = new Label("[0,100%]");
        pcTable.setWidget(rowIdxPcComple, 3, per0100Label);

        listBoxObs = new ListBox();
        pcTable.setWidget(rowIdxPcObserv, 1, listBoxObs);
        pcTable.getFlexCellFormatter().setColSpan(rowIdxPcObserv, 1, 2);

        listBoxObs.addItem(c.Standard());
        listBoxObs.addItem(c.Standard_no());
        listBoxObs.addItem(c.Standard_all());
        listBoxObs.addItem(c.Only_amides_a());
        listBoxObs.addItem(c.Only_amides());
        listBoxObs.addItem(c.All_theoretic());
        listBoxObs.addItem(c.All_non_hydro());
        listBoxObs.setWidth("6em");
        final Label observableAtomSetLabel = new Label(c.Observable_at());
        pcTable.setWidget(rowIdxPcObserv, 0, observableAtomSetLabel);
        nonePcCheckBox.setText(c.none());
        pcTable.removeRow(rowIdxPcComple); // deleting bottom up.
        pcTable.removeRow(rowIdxPcObserv); // TODO: enable when Wattos is run.
        pcTable.removeRow(rowIdxPcIntra);

        checkBoxOmega = new CheckBox();
        cingTable.setWidget(rowIdxCingOmega, 0, checkBoxOmega);
        checkBoxOmega.setEnabled(true);
        checkBoxOmega.setChecked(true);
        checkBoxOmega.setHTML("Omega");
        checkBoxOmega.addClickListener(new ClickListener() {
            public void onClick(final Widget sender) {
                Utils.setEnabledAllInColumnsButFirst(cingTable, 1, checkBoxOmega.isChecked());
            }
        });
        textBoxOmegaPoor = new TextBox();
        cingTable.setWidget(rowIdxCingOmega, 1, textBoxOmegaPoor);
        textBoxOmegaPoor.setStyleName("orange");
        textBoxOmegaPoor.setText(CRV_OMEGA_MAXALL_POOR);
        textBoxOmegaPoor.setWidth("3em");
        final Label andLabelOmega = new Label(c.and());
        cingTable.setWidget(rowIdxCingOmega, 2, andLabelOmega);
        textBoxOmegaBad = new TextBox();
        cingTable.setWidget(rowIdxCingOmega, 3, textBoxOmegaBad);
        cingTable.getCellFormatter().setHorizontalAlignment(rowIdxCingOmega, 3, HasHorizontalAlignment.ALIGN_CENTER);
        textBoxOmegaBad.setStylePrimaryName("red");
        textBoxOmegaBad.setText(CRV_OMEGA_MAXALL_BAD);
        textBoxOmegaBad.setWidth("3em");
        final Label labelDegreeOmega = new Label("\u00B0");
        cingTable.setWidget(rowIdxCingOmega, 4, labelDegreeOmega);

        textBoxDrMaxPoor = new TextBox();
        cingTable.setWidget(rowIdxCingDrMax, 1, textBoxDrMaxPoor);
        textBoxDrMaxPoor.setStyleName("orange");
        textBoxDrMaxPoor.setText(CRV_DR_MAXALL_POOR);
        textBoxDrMaxPoor.setWidth("3em");
        textBoxDrMaxBad = new TextBox();
        final Label andLabelDr = new Label(c.and());
        cingTable.setWidget(rowIdxCingDrMax, 2, andLabelDr);
        cingTable.setWidget(rowIdxCingDrMax, 3, textBoxDrMaxBad);
        cingTable.getCellFormatter().setHorizontalAlignment(rowIdxCingDrMax, 3, HasHorizontalAlignment.ALIGN_CENTER);
        textBoxDrMaxBad.setStylePrimaryName("red");
        textBoxDrMaxBad.setText(CRV_DR_MAXALL_BAD);
        textBoxDrMaxBad.setWidth("3em");
        final Label labelAng = new Label("\u00C5");
        cingTable.setWidget(rowIdxCingDrMax, 4, labelAng);
        checkBoxDrMax = new CheckBox();
        cingTable.setWidget(rowIdxCingDrMax, 0, checkBoxDrMax);
        checkBoxDrMax.setChecked(true);
        checkBoxDrMax.setHTML(c.Maximum_violatio());
        textBoxDrRmsPoor = new TextBox();
        cingTable.setWidget(rowIdxCingDrRms, 1, textBoxDrRmsPoor);
        textBoxDrRmsPoor.setStyleName("orange");
        textBoxDrRmsPoor.setText(CRV_DR_RMSALL_POOR);
        textBoxDrRmsPoor.setWidth("3em");
        textBoxDrRmsBad = new TextBox();
        final Label andLabelDrRms = new Label(c.and());
        cingTable.setWidget(rowIdxCingDrRms, 2, andLabelDrRms);
        cingTable.setWidget(rowIdxCingDrRms, 3, textBoxDrRmsBad);
        cingTable.getCellFormatter().setHorizontalAlignment(rowIdxCingDrRms, 3, HasHorizontalAlignment.ALIGN_CENTER);
        textBoxDrRmsBad.setStylePrimaryName("red");
        textBoxDrRmsBad.setText(CRV_DR_RMSALL_BAD);
        textBoxDrRmsBad.setWidth("3em");
        final Label labelAngDrRms = new Label("\u00C5");
        cingTable.setWidget(rowIdxCingDrRms, 4, labelAngDrRms);
        checkBoxDrRms = new CheckBox();
        cingTable.setWidget(rowIdxCingDrRms, 0, checkBoxDrRms);
        checkBoxDrRms.setChecked(true);
        checkBoxDrRms.setHTML(c.Rms_violatio());
        textBoxAcMaxPoor = new TextBox();
        cingTable.setWidget(rowIdxCingAcMax, 1, textBoxAcMaxPoor);
        textBoxAcMaxPoor.setStyleName("orange");
        textBoxAcMaxPoor.setText(CRV_AC_MAXALL_POOR);
        textBoxAcMaxPoor.setWidth("3em");
        textBoxAcMaxBad = new TextBox();
        final Label andLabelAc = new Label(c.and());
        cingTable.setWidget(rowIdxCingAcMax, 2, andLabelAc);
        cingTable.setWidget(rowIdxCingAcMax, 3, textBoxAcMaxBad);
        cingTable.getCellFormatter().setHorizontalAlignment(rowIdxCingAcMax, 3, HasHorizontalAlignment.ALIGN_CENTER);
        textBoxAcMaxBad.setStylePrimaryName("red");
        textBoxAcMaxBad.setText(CRV_AC_MAXALL_BAD);
        textBoxAcMaxBad.setWidth("3em");
        final Label labelDegreeAc = new Label("\u00B0");
        cingTable.setWidget(rowIdxCingAcMax, 4, labelDegreeAc);
        checkBoxAcMax = new CheckBox();
        cingTable.setWidget(rowIdxCingAcMax, 0, checkBoxAcMax);
        checkBoxAcMax.setChecked(true);
        checkBoxAcMax.setHTML(c.Maximum_violatio());
        textBoxAcRmsPoor = new TextBox();
        cingTable.setWidget(rowIdxCingAcRms, 1, textBoxAcRmsPoor);
        textBoxAcRmsPoor.setStyleName("orange");
        textBoxAcRmsPoor.setText(CRV_AC_RMSALL_POOR);
        textBoxAcRmsPoor.setWidth("3em");
        textBoxAcRmsBad = new TextBox();
        cingTable.setWidget(rowIdxCingAcRms, 2, new Label(c.and()));
        cingTable.setWidget(rowIdxCingAcRms, 3, textBoxAcRmsBad);
        cingTable.getCellFormatter().setHorizontalAlignment(rowIdxCingAcRms, 3, HasHorizontalAlignment.ALIGN_CENTER);
        textBoxAcRmsBad.setStylePrimaryName("red");
        textBoxAcRmsBad.setText(CRV_AC_RMSALL_BAD);
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;
        //        }
       
        // Then, we send the input to the server.
        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("Finding Loops...");
            serverResponseLabel.removeStyleName("serverResponseLabelError");

            serverResponseLabel.setHTML(result);
            dialogBox.center();
            closeButton.setFocus(true);
          }
        });
        */
      }
    }

    // Add a handler to send the name to the server
    MyHandler handler = new MyHandler();
    sendButton.addClickHandler(handler);
    nameField.addKeyUpHandler(handler);
  }
View Full Code Here

    // Create a new row to add to the UI.
    final int rowNumber = handlerTable.getRowCount();
    handlerTable.setWidget(rowNumber, 0, new Label("" + nextListenerId));
    handlerTable.setWidget(rowNumber, 1, new Label(a.valueOf()));

    final TextBox textBox = new TextBox();
    textBox.setReadOnly(true);
    textBox.setSize("30em", "1em");
    handlerTable.setWidget(rowNumber, 2, textBox);

    Button clearButton = new Button("Clear Text");
    clearButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        textBox.setText("");
      }

    });
    handlerTable.setWidget(rowNumber, 3, clearButton);

    Button removeHandlerButton = new Button("Remove Handler");
    handlerTable.setWidget(rowNumber, 4, removeHandlerButton);

    // Add event specific handlers
    switch (a) {
      case INFO_WINDOW_CLOSE_CLICK_HANDLER: {
        final InfoWindowCloseClickHandler h = new InfoWindowCloseClickHandler() {

          public void onCloseClick(InfoWindowCloseClickEvent event) {
            textBox.setText(textBox.getText() + "onCloseClick()");
          }

        };
        map.getInfoWindow().addInfoWindowCloseClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.getInfoWindow().removeInfoWindowCloseClickHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case INFO_WINDOW_MAXIMIZE_CLICK_HANDLER: {
        final InfoWindowMaximizeClickHandler h = new InfoWindowMaximizeClickHandler() {

          public void onMaximizeClick(InfoWindowMaximizeClickEvent event) {
            textBox.setText(textBox.getText() + "onMaximizeClick()");
          }

        };
        map.getInfoWindow().addInfoWindowMaximizeClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.getInfoWindow().removeInfoWindowMaximizeClickHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case INFO_WINDOW_MAXIMIZE_END_HANDLER: {
        final InfoWindowMaximizeEndHandler h = new InfoWindowMaximizeEndHandler() {

          public void onMaximizeEnd(InfoWindowMaximizeEndEvent event) {
            textBox.setText(textBox.getText() + "onMaximizeEnd()");
          }

        };
        map.getInfoWindow().addInfoWindowMaximizeEndHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.getInfoWindow().removeInfoWindowMaximizeEndHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case INFO_WINDOW_RESTORE_CLICK_HANDLER: {
        final InfoWindowRestoreClickHandler h = new InfoWindowRestoreClickHandler() {

          public void onRestoreClick(InfoWindowRestoreClickEvent event) {
            textBox.setText(textBox.getText() + "onRestoreClick()");
          }

        };
        map.getInfoWindow().addInfoWindowRestoreClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.getInfoWindow().removeInfoWindowRestoreClickHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case INFO_WINDOW_RESTORE_END_HANDLER: {
        final InfoWindowRestoreEndHandler h = new InfoWindowRestoreEndHandler() {

          public void onRestoreEnd(InfoWindowRestoreEndEvent event) {
            textBox.setText(textBox.getText() + "onRestoreEnd()");
          }

        };
        map.getInfoWindow().addInfoWindowRestoreEndHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.getInfoWindow().removeInfoWindowRestoreEndHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_INFO_WINDOW_BEFORE_CLOSE_HANDLER: {
        final MapInfoWindowBeforeCloseHandler h = new MapInfoWindowBeforeCloseHandler() {

          public void onInfoWindowBeforeClose(
              MapInfoWindowBeforeCloseEvent event) {
            textBox.setText(textBox.getText() + "onInfoWindowBeforeClose()");
          }

        };

        map.addInfoWindowBeforeCloseHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeInfoWindowBeforeCloseHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_INFO_WINDOW_CLOSE_HANDLER: {
        final MapInfoWindowCloseHandler h = new MapInfoWindowCloseHandler() {

          public void onInfoWindowClose(MapInfoWindowCloseEvent event) {
            textBox.setText(textBox.getText() + "onInfoWindowClose()");
          }

        };

        map.addInfoWindowCloseHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeInfoWindowCloseHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_INFO_WINDOW_OPEN_HANDLER: {
        final MapInfoWindowOpenHandler h = new MapInfoWindowOpenHandler() {

          public void onInfoWindowOpen(MapInfoWindowOpenEvent event) {
            textBox.setText(textBox.getText() + "onInfoWindowOpen()");
          }

        };

        map.addInfoWindowOpenHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeInfoWindowOpenHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_CLEAR_OVERLAYS_HANDLER: {
        final MapClearOverlaysHandler h = new MapClearOverlaysHandler() {

          public void onClearOverlays(MapClearOverlaysEvent event) {
            textBox.setText(textBox.getText() + "onClearOverlays()");
          }

        };

        map.addMapClearOverlaysHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapClearOverlaysHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_ADD_MAP_TYPE_HANDLER: {
        final MapAddMapTypeHandler h = new MapAddMapTypeHandler() {

          public void onAddMapType(MapAddMapTypeEvent event) {
            textBox.setText(textBox.getText() + "onAddMapType("
                + event.getType().getName(true) + ")");
          }

        };

        map.addMapAddMapTypeHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapAddMapTypeHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_ADD_OVERLAY_HANDLER: {
        final MapAddOverlayHandler h = new MapAddOverlayHandler() {

          public void onAddOverlay(MapAddOverlayEvent event) {
            textBox.setText(textBox.getText() + "onAddOverlay("
                + event.getOverlay() + ")");
          }

        };

        map.addMapAddOverlayHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapAddOverlayHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_CLICK_HANDLER: {
        final MapClickHandler h = new MapClickHandler() {

          public void onClick(MapClickEvent e) {
            String additionalText = "";
            if (e.getOverlay() != null) {
              additionalText = " Overlay clicked" + e.getOverlayLatLng();
            }
            textBox.setText(textBox.getText() + "onClick(" + e.getLatLng()
                + ")" + additionalText);
          }

        };
        map.addMapClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapClickHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_DOUBLE_CLICK_HANDLER: {
        final MapDoubleClickHandler h = new MapDoubleClickHandler() {

          public void onDoubleClick(MapDoubleClickEvent e) {
            textBox.setText(textBox.getText() + "onDoubleClick("
                + e.getLatLng() + ")");
          }
        };
        map.addMapDoubleClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapDoubleClickHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_DRAG_END_HANDLER: {
        final MapDragEndHandler h = new MapDragEndHandler() {

          public void onDragEnd(MapDragEndEvent event) {
            textBox.setText(textBox.getText() + "onDragEnd()");
          }

        };

        map.addMapDragEndHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapDragEndHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;
      case MAP_DRAG_HANDLER: {
        final MapDragHandler h = new MapDragHandler() {

          public void onDrag(MapDragEvent event) {
            textBox.setText(textBox.getText() + "onDrag()");
          }

        };

        map.addMapDragHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapDragHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_DRAG_START_HANDLER: {
        final MapDragStartHandler h = new MapDragStartHandler() {

          public void onDragStart(MapDragStartEvent event) {
            textBox.setText(textBox.getText() + "onDragStart()");
          }

        };

        map.addMapDragStartHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapDragStartHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_MOUSE_OUT_HANDLER: {
        final MapMouseOutHandler h = new MapMouseOutHandler() {

          public void onMouseOut(MapMouseOutEvent event) {
            textBox.setText(textBox.getText() + "onMouseOut("
                + event.getLatLng() + ")");
          }

        };

        map.addMapMouseOutHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapMouseOutHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_MOUSE_OVER_HANDLER: {
        final MapMouseOverHandler h = new MapMouseOverHandler() {

          public void onMouseOver(MapMouseOverEvent event) {
            textBox.setText(textBox.getText() + "onMouseOver("
                + event.getLatLng() + ")");
          }

        };

        map.addMapMouseOverHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapMouseOverHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;

      case MAP_MOUSE_MOVE_HANDLER: {
        final MapMouseMoveHandler h = new MapMouseMoveHandler() {

          public void onMouseMove(MapMouseMoveEvent event) {
            textBox.setText(textBox.getText() + "onMouseMove("
                + event.getLatLng() + ")");
          }
        };
        map.addMapMouseMoveHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapMouseMoveHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_MOVE_END_HANDLER: {
        final MapMoveEndHandler h = new MapMoveEndHandler() {

          public void onMoveEnd(MapMoveEndEvent e) {
            textBox.setText(textBox.getText() + "onMoveEnd()");
          }
        };
        map.addMapMoveEndHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapMoveEndHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_MOVE_HANDLER: {
        final MapMoveHandler h = new MapMoveHandler() {

          public void onMove(MapMoveEvent e) {
            textBox.setText(textBox.getText() + "onMove()");
          }
        };
        map.addMapMoveHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapMoveHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_MOVE_START_HANDLER: {
        final MapMoveStartHandler h = new MapMoveStartHandler() {

          public void onMoveStart(MapMoveStartEvent e) {
            textBox.setText(textBox.getText() + "onMoveStart()");
          }
        };
        map.addMapMoveStartHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapMoveStartHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_REMOVE_MAP_TYPE_HANDLER: {
        final MapRemoveMapTypeHandler h = new MapRemoveMapTypeHandler() {

          public void onRemoveMapType(MapRemoveMapTypeEvent event) {
            textBox.setText(textBox.getText() + "onRemoveMapType("
                + event.getType().getName(true) + ")");
          }

        };

        map.addMapRemoveMapTypeHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapRemoveMapTypeHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;
      case MAP_REMOVE_OVERLAY_HANDLER: {
        final MapRemoveOverlayHandler h = new MapRemoveOverlayHandler() {

          public void onRemoveOverlay(MapRemoveOverlayEvent event) {
            textBox.setText(textBox.getText() + "onRemoveOverlay("
                + event.getOverlay().toString() + ")");
          }

        };

        map.addMapRemoveOverlayHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            map.removeMapRemoveOverlayHandler(h);
            // removeRowFromTable(nextListenerId);
          }

        });
      }
        break;
      case MAP_RIGHT_CLICK_HANDLER: {
        final MapRightClickHandler h = new MapRightClickHandler() {

          public void onRightClick(MapRightClickEvent e) {
            textBox.setText(textBox.getText() + "onRightClick(" + e.getPoint()
                + ")");
          }
        };
        map.addMapRightClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapRightClickHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_TYPE_CHANGED_HANDLER: {
        final MapTypeChangedHandler h = new MapTypeChangedHandler() {

          public void onTypeChanged(MapTypeChangedEvent e) {
            textBox.setText(textBox.getText() + "onTypeChanged()");
          }
        };
        map.addMapTypeChangedHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapTypeChangedHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;

      case MAP_ZOOM_END_HANDLER: {
        final MapZoomEndHandler h = new MapZoomEndHandler() {

          public void onZoomEnd(MapZoomEndEvent e) {
            textBox.setText(textBox.getText() + "onZoomEnd("
                + e.getNewZoomLevel() + "," + e.getOldZoomLevel() + ")");
          }
        };
        map.addMapZoomEndHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            map.removeMapZoomEndHandler(h);
            // removeRowFromTable(nextListenerId);
          }
        });
      }
        break;
      case MARKER_CLICK_HANDLER: {

        final MarkerClickHandler h = new MarkerClickHandler() {

          public void onClick(MarkerClickEvent e) {
            textBox.setText(textBox.getText() + "onClick()");
          }
        };
        marker.addMarkerClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerClickHandler(h);
          }
        });
      }
        break;
      case MARKER_DOUBLE_CLICK_HANDLER: {

        final MarkerDoubleClickHandler h = new MarkerDoubleClickHandler() {

          public void onDoubleClick(MarkerDoubleClickEvent e) {
            textBox.setText(textBox.getText() + "onDoubleClick()");
          }
        };
        marker.addMarkerDoubleClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerDoubleClickHandler(h);
          }
        });
      }
        break;
      case MARKER_MOUSE_DOWN_HANDLER: {

        final MarkerMouseDownHandler h = new MarkerMouseDownHandler() {

          public void onMouseDown(MarkerMouseDownEvent e) {
            textBox.setText(textBox.getText() + "onMouseDown()");
          }
        };
        marker.addMarkerMouseDownHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerMouseDownHandler(h);
          }
        });
      }
        break;
      case MARKER_MOUSE_UP_HANDLER: {

        final MarkerMouseUpHandler h = new MarkerMouseUpHandler() {

          public void onMouseUp(MarkerMouseUpEvent e) {
            textBox.setText(textBox.getText() + "onMouseUp()");
          }
        };
        marker.addMarkerMouseUpHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerMouseUpHandler(h);
          }
        });
      }
        break;
      case MARKER_MOUSE_OVER_HANDLER: {

        final MarkerMouseOverHandler h = new MarkerMouseOverHandler() {

          public void onMouseOver(MarkerMouseOverEvent e) {
            textBox.setText(textBox.getText() + "onMouseOver()");
          }
        };
        marker.addMarkerMouseOverHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerMouseOverHandler(h);
          }
        });
      }
        break;
      case MARKER_MOUSE_OUT_HANDLER: {

        final MarkerMouseOutHandler h = new MarkerMouseOutHandler() {

          public void onMouseOut(MarkerMouseOutEvent e) {
            textBox.setText(textBox.getText() + "onMouseOut()");
          }
        };
        marker.addMarkerMouseOutHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerMouseOutHandler(h);
          }
        });
      }
        break;
      case MARKER_INFO_WINDOW_OPEN_HANDLER: {

        final MarkerInfoWindowOpenHandler h = new MarkerInfoWindowOpenHandler() {

          public void onInfoWindowOpen(MarkerInfoWindowOpenEvent e) {
            textBox.setText(textBox.getText() + "onInfoWindowOpen()");
          }
        };
        marker.addMarkerInfoWindowOpenHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerInfoWindowOpenHandler(h);
          }
        });
      }
        break;
      case MARKER_INFO_WINDOW_BEFORECLOSE_HANDLER: {

        final MarkerInfoWindowBeforeCloseHandler h = new MarkerInfoWindowBeforeCloseHandler() {

          public void onInfoWindowBeforeClose(MarkerInfoWindowBeforeCloseEvent e) {
            textBox.setText(textBox.getText() + "onInfoWindowBeforeClose()");
          }
        };
        marker.addMarkerInfoWindowBeforeCloseHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerInfoWindowBeforeCloseHandler(h);
          }
        });
      }
        break;
      case MARKER_INFO_WINDOW_CLOSE_HANDLER: {

        final MarkerInfoWindowCloseHandler h = new MarkerInfoWindowCloseHandler() {

          public void onInfoWindowClose(MarkerInfoWindowCloseEvent e) {
            textBox.setText(textBox.getText() + "onInfoWindowClose()");
          }
        };
        marker.addMarkerInfoWindowCloseHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerInfoWindowCloseHandler(h);
          }
        });
      }
        break;
      case MARKER_REMOVE_HANDLER: {

        final MarkerRemoveHandler h = new MarkerRemoveHandler() {

          public void onRemove(MarkerRemoveEvent e) {
            textBox.setText(textBox.getText() + "onRemove()");
          }
        };
        marker.addMarkerRemoveHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerRemoveHandler(h);
          }
        });
      }
        break;
      case MARKER_DRAG_START_HANDLER: {

        final MarkerDragStartHandler h = new MarkerDragStartHandler() {

          public void onDragStart(MarkerDragStartEvent e) {
            textBox.setText(textBox.getText() + "onDragStart()");
          }
        };
        marker.addMarkerDragStartHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerDragStartHandler(h);
          }
        });
      }
        break;
      case MARKER_DRAG_HANDLER: {

        final MarkerDragHandler h = new MarkerDragHandler() {

          public void onDrag(MarkerDragEvent e) {
            textBox.setText(textBox.getText() + "onDrag()");
          }
        };
        marker.addMarkerDragHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerDragHandler(h);
          }
        });
      }
        break;
      case MARKER_DRAG_END_HANDLER: {

        final MarkerDragEndHandler h = new MarkerDragEndHandler() {

          public void onDragEnd(MarkerDragEndEvent e) {
            textBox.setText(textBox.getText() + "onDragEnd()");
          }
        };
        marker.addMarkerDragEndHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerDragEndHandler(h);
          }
        });
      }
        break;
      case MARKER_VISIBILITY_CHANGED_HANDLER: {

        final MarkerVisibilityChangedHandler h = new MarkerVisibilityChangedHandler() {

          public void onVisibilityChanged(MarkerVisibilityChangedEvent e) {
            textBox.setText(textBox.getText() + "onVisibilityChanged("
                + e.isVisible() + ")");
          }
        };
        marker.addMarkerVisibilityChangedHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            marker.removeMarkerVisibilityChangedHandler(h);
          }
        });
      }
        break;

      case POLYLINE_CLICK_HANDLER: {

        final PolylineClickHandler h = new PolylineClickHandler() {

          public void onClick(PolylineClickEvent e) {
            textBox.setText(textBox.getText() + "onClick(" + e.getLatLng()
                + ")");
          }

        };
        polyline.addPolylineClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polyline.removePolylineClickHandler(h);
          }

        });
      }
        break;

      case POLYLINE_REMOVE_HANDLER: {

        final PolylineRemoveHandler h = new PolylineRemoveHandler() {

          public void onRemove(PolylineRemoveEvent e) {
            textBox.setText(textBox.getText() + "onRemove()");
          }

        };
        polyline.addPolylineRemoveHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polyline.removePolylineRemoveHandler(h);
          }

        });
      }
        break;

      case POLYLINE_VISIBILITY_CHANGED_HANDLER: {

        final PolylineVisibilityChangedHandler h = new PolylineVisibilityChangedHandler() {

          public void onVisibilityChanged(PolylineVisibilityChangedEvent e) {
            textBox.setText(textBox.getText() + "onVisibilityChanged("
                + e.isVisible() + ")");
          }

        };
        polyline.addPolylineVisibilityChangedHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polyline.removePolylineVisibilityChangedHandler(h);
          }

        });
      }
        break;

      case POLYLINE_MOUSEOUT_HANDLER: {

        final PolylineMouseOutHandler h = new PolylineMouseOutHandler() {

          public void onMouseOut(PolylineMouseOutEvent e) {
            textBox.setText(textBox.getText() + "onMouseOut()");
          }

        };
        polyline.addPolylineMouseOutHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polyline.removePolylineMouseOutHandler(h);
          }

        });
      }
        break;

      case POLYLINE_MOUSEOVER_HANDLER: {

        final PolylineMouseOverHandler h = new PolylineMouseOverHandler() {

          public void onMouseOver(PolylineMouseOverEvent e) {
            textBox.setText(textBox.getText() + "onMouseOver()");
          }

        };
        polyline.addPolylineMouseOverHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polyline.removePolylineMouseOverHandler(h);
          }

        });
      }
        break;

      case POLYGON_CLICK_HANDLER: {

        final PolygonClickHandler h = new PolygonClickHandler() {

          public void onClick(PolygonClickEvent e) {
            textBox.setText(textBox.getText() + "onClick(" + e.getLatLng()
                + ")");
          }

        };
        polygon.addPolygonClickHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polygon.removePolygonClickHandler(h);
          }

        });
      }
        break;

      case POLYGON_REMOVE_HANDLER: {

        final PolygonRemoveHandler h = new PolygonRemoveHandler() {

          public void onRemove(PolygonRemoveEvent e) {
            textBox.setText(textBox.getText() + "onRemove()");
          }

        };
        polygon.addPolygonRemoveHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polygon.removePolygonRemoveHandler(h);
          }

        });
      }
        break;

      case POLYGON_VISIBILITY_CHANGED_HANDLER: {

        final PolygonVisibilityChangedHandler h = new PolygonVisibilityChangedHandler() {

          public void onVisibilityChanged(PolygonVisibilityChangedEvent e) {
            textBox.setText(textBox.getText() + "onVisibilityChanged("
                + e.isVisible() + ")");
          }

        };
        polygon.addPolygonVisibilityChangedHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polygon.removePolygonVisibilityChangedHandler(h);
          }

        });
      }
        break;

      case POLYGON_MOUSEOUT_HANDLER: {

        final PolygonMouseOutHandler h = new PolygonMouseOutHandler() {

          public void onMouseOut(PolygonMouseOutEvent e) {
            textBox.setText(textBox.getText() + "onMouseOut()");
          }

        };
        polygon.addPolygonMouseOutHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {

          public void onClick(ClickEvent event) {
            polygon.removePolygonMouseOutHandler(h);
          }

        });
      }
        break;

      case POLYGON_MOUSEOVER_HANDLER: {

        final PolygonMouseOverHandler h = new PolygonMouseOverHandler() {

          public void onMouseOver(PolygonMouseOverEvent e) {
            textBox.setText(textBox.getText() + "onMouseOver()");
          }

        };
        polygon.addPolygonMouseOverHandler(h);
        removeHandlerButton.addClickHandler(new ClickHandler() {
View Full Code Here

    /**
     * Allows a UTCTimeBox to be created with a specified format.
     */
    public UTCTimeBoxImplHtml4() {
        this.textbox = new TextBox();

        TextBoxHandler handler = new TextBoxHandler();
        textbox.addKeyDownHandler(handler);
        textbox.addBlurHandler(handler);
        textbox.addClickHandler(handler);
View Full Code Here

        verify(input).setValue("hello");
    }

    /** Test fillInputMultiple() for ValueBoxBase, list (null). */
    @Test public void testFillInputMultipleValueBoxListNull() {
        TextBox input = mock(TextBox.class);
        List<String> list = null;
        ViewDataUtils.fillInputMultiple(input, list);
        verify(input).setValue(null);
    }
View Full Code Here

        verify(input).setValue(null);
    }

    /** Test fillInputMultiple() for ValueBoxBase, list (empty). */
    @Test public void testFillInputMultipleValueBoxListEmpty() {
        TextBox input = mock(TextBox.class);
        List<String> list = new ArrayList<String>();
        ViewDataUtils.fillInputMultiple(input, list);
        verify(input).setValue(null);
    }
View Full Code Here

TOP

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

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.