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

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


  }

  @Override
  protected void setup() {
    // Set up backwards.
    backwards = new PushButton();
    backwards.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        addMonths(-1);
      }
    });
    backwards.getUpFace().setHTML("‹");
    backwards.setStyleName(BASE_NAME + "PreviousButton");
    forwards = new PushButton();
    forwards.getUpFace().setHTML("›");
    forwards.setStyleName(BASE_NAME + "NextButton");
    forwards.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        addMonths(+1);
      }
    });
    // Set up backwards year
    backwardsYear = new PushButton();
    backwardsYear.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        addMonths(-12);
      }
    });
    backwardsYear.getUpFace().setHTML("«");
    backwardsYear.setStyleName(BASE_NAME + "PreviousButton");
    forwardsYear = new PushButton();
    forwardsYear.getUpFace().setHTML("»");
    forwardsYear.setStyleName(BASE_NAME + "NextButton");
    forwardsYear.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
View Full Code Here


        lb.addItem(strings.xxlarge());
        return lb;
    }

    private PushButton createPushButton(ImageResource img, String tip) {
        final PushButton pb = new PushButton(new Image(img));
        pb.addClickHandler(handler);
        pb.setTitle(tip);
        return pb;
    }
View Full Code Here

        if (lastCupID > -1)
          cupArray.clear();
      }
    };

    PushButton removeButton = new PushButton(coffeeImages.removeIcon()
        .createImage(), removeButtonListener);

    // Define the oracle that finds drink suggestions
    final MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
    oracle.add("Latte");
View Full Code Here

   *
   * @param color the color
   * @return the widget
   */
  private Widget createCell(final String color) {
    final PushButton button = new PushButton();
    button.setStylePrimaryName(style.simplecolorbutton());
    button.setSize(CELL_SIZE, CELL_SIZE);
    button.getElement().getStyle().setBackgroundColor(color);
    return button;
  }
View Full Code Here

    textbox = new TextBox();
    textbox.setVisibleLength(8);
    textbox.setValue("#000000");
    textbox.addStyleName(ComplexColorPicker.style.margins());

    PushButton custom = new PushButton("Custom...");
    custom.addStyleName(ComplexColorPicker.style.buttonsMargins());
    custom.setStylePrimaryName(ComplexColorPicker.style.customColorPushbutton());
    custom.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        // ComplexColorPicker is a DeckPanel, so we show our widget
        colorPicker.showWidget(1);
        textbox.setFocus(true);
View Full Code Here

  public ComplexColorPicker() {
    style.ensureInjected();

    // The background color can be set to "none"
    noneBtn = new PushButton(messages.none());
    noneBtn.addStyleName(ComplexColorPicker.style.buttonsMargins());
    noneBtn.setStylePrimaryName(ComplexColorPicker.style.customColorPushbutton());
    noneBtn.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
View Full Code Here

        lb.setTabIndex(-1);
        return lb;
    }

    private PushButton createPushButton(ImageResource img, String tip) {
        final PushButton pb = new PushButton(new Image(img));
        pb.addClickHandler(handler);
        pb.setTitle(tip);
        pb.setTabIndex(-1);
        return pb;
    }
View Full Code Here

   * Constructs a new instance of a GwtGL example with a launch button and a
   * Canvas to render on.
   */
  protected AbstractGwtGLExample() {
    // create the button to launch the example
    final PushButton button = new PushButton("Launch example!");
    setWidget(0, 0, button);
   
    // create the WebGL Canvas
    webGLCanvas = Canvas.createIfSupported();
    webGLCanvas.setCoordinateSpaceHeight(500);
    webGLCanvas.setCoordinateSpaceWidth(500);
    glContext = (WebGLRenderingContext) webGLCanvas.getContext("experimental-webgl");
    if(glContext == null) {
      Window.alert("Sorry, Your Browser doesn't support WebGL!");
    }
    glContext.viewport(0, 0, 500, 500);

    setWidget(1, 0, webGLCanvas);

    // add a ClickHandler to start the example when the button is clicked
    button.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        button.setEnabled(false);
        start();
        webGLCanvas.setFocus(true);
      }
    });
  }
View Full Code Here

   * Constructs a new instance of a GwtGL example with a launch button and a
   * Canvas to render on.
   */
  protected AbstractGwtGLExample() {
    // create the button to launch the example
    final PushButton button = new PushButton("Launch example!");
    setWidget(0, 0, button);
   
    WebGLContextAttributes contextAttributes = WebGLContextAttributes.create();
    contextAttributes.setAlpha(false);

    // create the WebGL Canvas
    webGLCanvas = new WebGLCanvas(contextAttributes, "500px", "500px");
    glContext = webGLCanvas.getGlContext();
    glContext.viewport(0, 0, 500, 500);

    setWidget(1, 0, webGLCanvas);

    // add a ClickHandler to start the example when the button is clicked
    button.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        button.setEnabled(false);
        start();
        webGLCanvas.setFocus(true);
      }
    });
  }
View Full Code Here

      imgPageFirst = imageBundle.page_first().createImage();
      imgPagePrev = imageBundle.page_prev().createImage();
      imgPageNext = imageBundle.page_next().createImage();
      imgPageLast = imageBundle.page_last().createImage();

      btnPageFirst = new PushButton(imgPageFirst, this);
      btnPagePrev = new PushButton(imgPagePrev, this);
      btnPageNext = new PushButton(imgPageNext, this);
      btnPageLast = new PushButton(imgPageLast, this);

      tbPage.addKeyUpHandler(this);
      tbPage.addChangeHandler(this);
      tbPage.setMaxLength(4);
      tbPage.setStyleName(Styles.PAGE);

      // prev buttons (divs)
      addButton(btnPageFirst, "First Page");
      addButton(btnPagePrev, "Previous Page");

      // separator
      split = imageBundle.split().createImage();
      split.setStylePrimaryName(Toolbar.Styles.SPLIT);
      add(split);

      // Page x of y
      final FlowPanel pageXofY = new FlowPanel();
      pageXofY.addStyleName(Styles.PAGE_CONTAINER);
      pageXofY.add(lblPagePre);
      pageXofY.add(tbPage);
      pageXofY.add(lblPagePost);
      add(pageXofY);

      // separator
      split = imageBundle.split().createImage();
      split.setStylePrimaryName(Toolbar.Styles.SPLIT);
      add(split);

      // next buttons (divs)
      addButton(btnPageNext, "Next Page");
      addButton(btnPageLast, "Last Page");
    }

    // show refresh button?
    if(config.isShowRefreshBtn()) {
      imgRefresh = imageBundle.refresh().createImage();
      btnRefresh = new PushButton(imgRefresh, this);

      if(pageSize > 0) {
        // separator
        split = imageBundle.split().createImage();
        split.setStylePrimaryName(Toolbar.Styles.SPLIT);
        add(split);
      }
      addButton(btnRefresh, "Refresh");
    }

    // show add button?
    if(addRowHandler != null) {
      // imgAdd = imageBundle.add().createImage();
      final String title = "Add " + config.getListingElementName();
      btnAdd = new PushButton(title, this);
      if(pageSize > 0 || config.isShowRefreshBtn()) {
        // separator
        split = imageBundle.split().createImage();
        split.setStylePrimaryName(Toolbar.Styles.SPLIT);
        add(split);
View Full Code Here

TOP

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

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.