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

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


      panel.add(lbl);
      final TextBox box = new TextBox();
      box.setText("What is the meaning of life?");
      panel.add(box);
      Button ok = new Button("Ask");
      ok.addClickListener(new ClickListener()
      {
         public void onClick(Widget w)
         {
            ValidationUtility valid = new ValidationUtility();
            if (!valid.isValid(box.getText()))
View Full Code Here


        }
    }

    public void onModuleLoad() {

        buttonSendMessage.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
                if (!"".equals(textBoxNewMessage.getText())) {
                    JSONArray array = new JSONArray();
                    array.set(0, new JSONString(textBoxNewMessage.getText()));

                    JSONObject container = new JSONObject();
                    container.put("value", array);

                    streamingService.sendMessage(textBoxTopic.getText(), container);
                    textBoxNewMessage.setText("");
                    textBoxNewMessage.setFocus(true);
                }
            }
        });
        buttonSendMessage.setEnabled(false);

        buttonSubscribe.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
                if (!"".equals(textBoxTopic.getText())) {
                    streamingService.subScribeToEvent(textBoxTopic.getText(), new ChatCallback(textBoxTopic.getText()));
                    buttonSendMessage.setEnabled(true);
View Full Code Here

                public void onKeyPress(Widget sender, char keyCode, int modifiers) {
                }
            });

            //Handle button click
            bidButton.addClickListener(new ClickListener() {

                public void onClick(Widget sender) {
                    sendNewBid(item, txtBoxMyBid, labelMessage);
                }
            });
View Full Code Here

    prevImage = images.pagingOptionsPrevPage().createImage();
    nextImage = images.pagingOptionsNextPage().createImage();
    lastImage = images.pagingOptionsLastPage().createImage();

    // Create the listener
    ClickListener listener = new ClickListener() {
      public void onClick(Widget sender) {
        if (sender == firstImage) {
          table.gotoFirstPage();
        } else if (sender == lastImage) {
          table.gotoLastPage();
View Full Code Here

    // Set video ID option
    final TextBox videoIDBox = new TextBox();
    videoIDBox.setText("iuywmPePYKQ");
    grid.setHTML(0, 0, "<B>Video ID:</B>");
    grid.setWidget(0, 1, videoIDBox);
    grid.setWidget(0, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setMovieID(videoIDBox.getText());
      }
    }));

    // Set player width
    final TextBox widthBox = new TextBox();
    widthBox.setText("443px");
    grid.setHTML(1, 0, "<B>Width:</B>");
    grid.setWidget(1, 1, widthBox);
    grid.setWidget(1, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setWidth(widthBox.getText());
      }
    }));

    // Set player height
    final TextBox heightBox = new TextBox();
    heightBox.setText("369px");
    grid.setHTML(2, 0, "<B>Height:</B>");
    grid.setWidget(2, 1, heightBox);
    grid.setWidget(2, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setHeight(heightBox.getText());
      }
    }));

    // Plugins page
    final TextBox pluginsBox = new TextBox();
    pluginsBox.setText("http://www.google.com");
    grid.setHTML(3, 0, "<B>Plugins Page:</B>");
    grid.setWidget(3, 1, pluginsBox);
    grid.setWidget(3, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        EmbeddedObjectInfo info = mainViewer.getInfo();
        info.setPluginsPage(pluginsBox.getText());
        mainViewer.setInfo(info);
      }
    }));

    // Enabled/disable autoplay
    grid.setWidget(4, 0, new Button("Enable AutoPlay", new ClickListener() {
      public void onClick(Widget sender) {
        if (mainViewer.isAutoPlayEnabled()) {
          mainViewer.setAutoPlayEnabled(false);
          ((Button) sender).setText("Enable AutoPlay");
        } else {
          mainViewer.setAutoPlayEnabled(true);
          ((Button) sender).setText("Disable AutoPlay");
        }
      }
    }));

    // Enabled/disable related videos
    grid.setWidget(4, 1, new Button("Enable Related", new ClickListener() {
      public void onClick(Widget sender) {
        if (mainViewer.isRelatedVideosEnabled()) {
          mainViewer.setRelatedVideosEnabled(false);
          ((Button) sender).setText("Enable Related");
        } else {
View Full Code Here

        Button submitB = new Button("Create Thread");
        if (isReply) {
            submitB.setText("Post Reply");
        }

        submitB.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
                app
                        .create(author, titleBox.getText(), textArea
                                .getHTML());
                createPostDialog.hide();
            }

        });
        cancelB.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
                createPostDialog.hide();
            }
        });
View Full Code Here

    VerticalPanel p = new VerticalPanel();
    ScrollPanel scroller = new ScrollPanel();
    contents = new VerticalPanel();
    scroller.add(contents);

    p.add(new Button("clear log", new ClickListener() {
      public void onClick(Widget sender) {
        contents.clear();
      }
    }));
    p.add(scroller);
View Full Code Here

    p.setCellWidth(label, "100%");
    forwards.addStyleName(Styles.MONTH_FORWARD);
    initWidget(p);
    setStyleName(Styles.MONTH_SELECTOR);

    backwards.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        addMonths(-1);
      }
    });

    forwards.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        addMonths(+1);
      }
    });
  }
View Full Code Here

    rootPanel.add(currencyWidget, 50, 56);
   
    final Button clickMeButton = new Button();
    rootPanel.add(clickMeButton, 250, 56);
    clickMeButton.setText("See what you got!");
    clickMeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        Window.alert("You entered: " + Double.toString(currencyWidget.getAmount()));
      }
    });


    final Label currencyWidgetWithPreviewLabel = new Label("Currency Widget With Preview");
    rootPanel.add(currencyWidgetWithPreviewLabel, 50, 108);

    final CurrencyWidgetWithPreview currencyWidgetWithPreview = new CurrencyWidgetWithPreview("EUR");
    rootPanel.add(currencyWidgetWithPreview, 50, 132);
    currencyWidgetWithPreview.setSize("156px", "18px");

    final Button seeWhatYouButton = new Button();
    rootPanel.add(seeWhatYouButton, 250, 132);
    seeWhatYouButton.setSize("157px", "24px");
    seeWhatYouButton.setText("See what you got!");
    seeWhatYouButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        Window.alert("You entered: " + Double.toString(currencyWidgetWithPreview.getAmount()));
      }
    });
View Full Code Here

    l.setStyleName("filler");
    p.add(l);
    p.add(end);
    HorizontalPanel h2 = new HorizontalPanel();
    v.add(h2);
    h2.add(new Button("Short format", new ClickListener() {

      public void onClick(Widget sender) {
        start.setDateFormat(DateTimeFormat.getShortDateFormat());
        end.setDateFormat(DateTimeFormat.getShortDateFormat());
      }
    }));
    h2.add(new Button("Long format", new ClickListener() {

      public void onClick(Widget sender) {
        start.setDateFormat(DateTimeFormat.getLongDateFormat());
        end.setDateFormat(DateTimeFormat.getLongDateFormat());
      }
View Full Code Here

TOP

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

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.