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

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


    p.setHeight("1px");
    p.becomeCollapsed();
    RootPanel.get().add(p);

    // Hook a toggle button.
    p.hookupControlToggle(new ToggleButton("Toggle"));

    // Fire an event on the hover bar that will trigger a delayed timer.
    NativeEvent event = Document.get().createMouseOverEvent(0, 0, 0, 0, 0,
        false, false, false, false, 0, null);
    p.getHoverBar().getElement().dispatchEvent(event);
View Full Code Here


      throw e;
    }
  }

  private Panel createSchoolNavBar() {
    controlButton = new ToggleButton();
    if (LocaleInfo.getCurrentLocale().isRTL()) {
      controlButton.getUpFace().setHTML("<i>click to pin &larr; </i>");
      controlButton.getDownFace().setHTML("<i> &rarr; click to collapse</i>  ");
    } else {
      controlButton.getUpFace().setHTML("<i>click to pin &rarr;</i>");
View Full Code Here

    numTrials = new TextBox();
    hp2.add(numTrials);
    vp.add(hp2);
    vp.add(randomOrEqual);

    final ToggleButton showFreq = new ToggleButton("Show Freq Table",
        "Hide Freq Table");
    showFreq.addClickHandler(new ClickHandler() {

      private FreqPopup fp;

      public void onClick(ClickEvent event) {
        if (showFreq.isDown()) {
          if (fp == null) {
            fp = new FreqPopup(freq);
            // fp.setAutoHideEnabled(true);
          } else {
            fp.update(freq);
View Full Code Here

      throw e;
    }
  }

  private Panel createSchoolNavBar() {
    ToggleButton toggler = new ToggleButton("Directory (click to pin)",
        "Directory (click to collapse)");
    toggler.setStyleName("CollapsibleToggle");
    controlButton = toggler;

    MyStackPanel wrapper = new MyStackPanel();
    FlowPanel navBar = new FlowPanel();
    navBar.setSize("200px", "100%");
View Full Code Here

  public ViewToolbar(String viewDisplayName, ViewOptions viewOptions, ClickHandler clickHandler) {
    super();
    assert viewDisplayName != null && viewOptions != null && clickHandler != null;
    viewTitle = new Label(viewDisplayName);
    btnMinimize =
      viewOptions.isMinimizable() ? new ToggleButton(imageBundle.arrow_sm_down().createImage(), imageBundle
          .arrow_sm_right().createImage(), clickHandler) : null;
      btnPop =
        viewOptions.isPopable() ? new ToggleButton(imageBundle.external().createImage(), imageBundle.permalink()
            .createImage(), clickHandler) : null;

        btnClose = viewOptions.isClosable() ? new PushButton(imageBundle.close().createImage(), clickHandler) : null;
        btnRefresh = viewOptions.isRefreshable() ? new PushButton(imageBundle.refresh().createImage(), clickHandler) : null;
View Full Code Here

  public ViewToolbar(final String viewDisplayName, final ViewOptions viewOptions, final ClickHandler clickHandler) {
    super();
    assert viewDisplayName != null && viewOptions != null && clickHandler != null;
    viewTitle = new Label(viewDisplayName);
    btnMinimize =
        viewOptions.isMinimizable() ? new ToggleButton(AbstractImagePrototype.create(resources.arrow_sm_down())
            .createImage(), AbstractImagePrototype.create(resources.arrow_sm_right()).createImage(), clickHandler)
            : null;
    btnPop =
        viewOptions.isPopable() ? new ToggleButton(AbstractImagePrototype.create(resources.external()).createImage(),
            AbstractImagePrototype.create(resources.permalink()).createImage(), clickHandler) : null;

    btnClose =
        viewOptions.isClosable() ? new PushButton(AbstractImagePrototype.create(resources.close()).createImage(),
            clickHandler) : null;
View Full Code Here

            }
        });
       
        RootPanel.get("toolbar").add(button);
       
        final ToggleButton toggle = new ToggleButton("Overflow");
       
        toggle.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                overflow(toggle.isDown());
            }
        });
       
        RootPanel.get("toolbar").add(toggle);
    }
View Full Code Here

  }
 
  private void select(ToggleButton btn) {
    // update UI
    for (T key : buttonsMap.keySet()) {
      ToggleButton otherBtn = buttonsMap.get(key);
     
      if (btn == otherBtn) { // notify listeners
        btn.setDown(true)// may be triggered in code level
        for (SelectionChangeListener<T> listener : listeners) {
          listener.onSelect(key);
        }
      } else // reset other button
        otherBtn.setDown(false);
      }
    }
  }
View Full Code Here

   
    while (key != null) {
      keys.add(0, key);
     
      // render buttons on control panel
      ToggleButton btn = new ToggleButton(key.asSingleNodeDesc());
      btn.getElement().getStyle().setFloat(Style.Float.LEFT);
     
      // parent always goes the first
      switchControlPanel.insert(btn, 0);
      btnGroup.addButton(key, btn);
View Full Code Here

   *          a click handler to which to bind the button
   * @return the button
   */
  public static ToggleButton createToggleButtonWithImageStates(Image upImage,
      Image hvImage, Image dnImage, String styleName, ClickHandler handler) {
    final ToggleButton button = createToggleButtonWithImageStates(upImage,
        hvImage, styleName, handler);
    button.getDownFace().setImage(dnImage);
    return button;
  }
View Full Code Here

TOP

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

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.