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

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


        return pb;
    }

    private ToggleButton createToggleButton(AbstractImagePrototype img,
            String tip) {
        ToggleButton tb = new ToggleButton(img.createImage());
        tb.addClickListener(listener);
        tb.setTitle(tip);
        return tb;
    }
View Full Code Here


  }

  private ToggleButton createToggleButton() {
    Image show = new Image("unpinned.gif");
    Image hide = new Image("pinned.gif");
    ToggleButton toggler = new ToggleButton(hide, show);
    return toggler;
  }
View Full Code Here

  void setToggleButtons(int searchIndex) {
    buttons.clear();
    int idx = 0;
    for ( String uri : VineMain.getWorkingUris() ) {
      String id = VineMain.index2code(idx);
      final ToggleButton sel = new ToggleButton("" +id);
      DOM.setElementAttribute(sel.getElement(), "id", "my-button-id");
      buttons.add(sel);
     
      BaseOntologyInfo s = VineMain.getOntologyInfo(uri);
      if ( s != null ) {
        sel.setTitle(s.getDisplayLabel());
        sel.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            // TODO update some variable indicating the selected ontologies for search
          }
        });
        if ( searchIndex == idx ) {
          sel.setDown(true);
        }
      }
      else {
        sel.setEnabled(false);
        sel.setTitle("This is not a registered ontology");
      }
     
      idx++;
    }
   
View Full Code Here

        "(not implemented yet)."
    ));

   
    // TODO implement REGEX search
    regex = new ToggleButton("REGEX");
    DOM.setElementAttribute(regex.getElement(), "id", "my-button-id");
    regex.setTitle("Check this to apply a regular expression search - NOT IMPLEMENTED YET");
   
   
   
View Full Code Here

        link.setText(entry.getTitle());
        link.setTarget("_blank");
        if (entry.getType().equalsIgnoreCase("document")) {
          link.setHref("/docs?docid=" + entry.getDocumentId());
        }
        ToggleButton star = new ToggleButton(
            Icons.editorIcons.StarEmpty().createImage(),
            Icons.editorIcons.StarFull().createImage());
        star.setDown(entry.isStarred());
        star.addClickHandler(new ClickHandler(){
          public void onClick(ClickEvent event) {
            ToggleButton btn = (ToggleButton)event.getSource();
            if (btn.isDown()) {
              CommandEvent.fire(new SystemStarDocumentCommand(id));
            } else {
              CommandEvent.fire(new SystemUnstarDocumentCommand(id));
            }
          }
View Full Code Here

  }
 
  public void setButtonState(int index, boolean down) {
    Widget btn = buttons.get(index);
    if (btn instanceof ToggleButton) {
      ToggleButton tbtn = (ToggleButton) btn;
      tbtn.setDown(down);
    }
  }
View Full Code Here

     * @param command the command type for the toolbar button
     * @return a toolbar button
     */
    protected Widget buildButton(AbstractImagePrototype icon, String title, boolean isToggle, final Command command){
      if(isToggle){
        final ToggleButton btn = new ToggleButton(icon.createImage());
        btn.setTitle(title);
        btn.addClickHandler(new ClickHandler(){
          public void onClick(ClickEvent event) {
            CommandEvent.fire(command);
          }
        });
        return btn;
      } else {
        final PushButton btn = new PushButton(icon.createImage());
        btn.setTitle(title);
        btn.addClickHandler(new ClickHandler(){
          public void onClick(ClickEvent event) {
            CommandEvent.fire(command);
          }
        });
        return btn;
View Full Code Here

   * @param command the command type for the toolbar button
   * @return a toolbar button
   */
  private Widget buildButton(AbstractImagePrototype icon, String title, boolean isToggle, final Command command){
    if(isToggle){
      final ToggleButton btn = new ToggleButton(icon.createImage());
      btn.setTitle(title);
      btn.addClickHandler(new ClickHandler(){
        public void onClick(ClickEvent event) {
          btn.setFocus(false);
          btn.removeStyleName("gwt-ToggleButton-up-hovering");
          CommandEvent.fire(command);
        }
      });
      buttons.add(btn);
      return btn;
    }else{
      final PushButton btn = new PushButton(icon.createImage());
      btn.setTitle(title);
      btn.addClickHandler(new ClickHandler(){
        public void onClick(ClickEvent event) {
          btn.setFocus(false);
          btn.removeStyleName("gwt-PushButton-up-hovering");
          CommandEvent.fire(command);
        }
      });
      buttons.add(btn);
      return btn;
View Full Code Here

      this.checkBox = new CheckBox(label);
    }
    this.panel.add(this.checkBox);
    } else {
    if (starHandler != null) {
          ToggleButton star = new ToggleButton(
              Icons.editorIcons.StarEmpty().createImage(),
              Icons.editorIcons.StarFull().createImage());
          star.setDown(starred);
          star.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
          ToggleButton btn = (ToggleButton) event.getSource();
          if (btn.isDown()) {
          starHandler.onStar(ExplorerTreeItem.this.value);
          } else {
          starHandler.onUnstar(ExplorerTreeItem.this.value);
          }
      }
View Full Code Here

  }
 
  public void setButtonState(int index, boolean down) {
    Widget btn = buttons.get(index);
    if (btn instanceof ToggleButton) {
      ToggleButton tbtn = (ToggleButton) btn;
      tbtn.setDown(down);
    }
  }
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.