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

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


   * @return a toolbar button
   */
  private Widget buildButton(AbstractImagePrototype icon, String title, boolean isToggle,
      final com.google.gwt.user.client.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");
          command.execute();
        }
      });
      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");
          command.execute();
        }
      });
      buttons.add(btn);
      return btn;
View Full Code Here


    pb.setTitle(tip);
    return pb;
  }

  private ToggleButton createToggleButton(ImageResource img, String tip) {
    ToggleButton tb = new ToggleButton(new Image(img));
    tb.addClickHandler(handler);
    tb.setTitle(tip);
    return tb;
  }
View Full Code Here

    pb.setTitle(tip);
    return pb;
  }

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

        pb.setTitle(tip);
        return pb;
    }

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

    tabLayoutPanel.setSize("1000px", "600px");
   
    AbsolutePanel absolutePanel_1 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_1, "Detección", false);
   
    final ToggleButton btnComunidades = new ToggleButton("Comunidades");
    btnComunidades.setDown(true);
   

    absolutePanel_1.add(btnComunidades, 10, 10);
   
    final ToggleButton btnFamilias = new ToggleButton("Familias");
    absolutePanel_1.add(btnFamilias, 111, 10);
   
    TextBox textBox = new TextBox();
    absolutePanel_1.add(textBox, 699, 10);
    textBox.setSize("212px", "15px");
   
    Button btnBuscar = new Button("Buscar");
    absolutePanel_1.add(btnBuscar, 931, 10);
   
    final AbsolutePanel comunidadesPanel = new AbsolutePanel();
    absolutePanel_1.add(comunidadesPanel, 10, 50);
    comunidadesPanel.setSize("978px", "520px");
   
    DecoratedTabPanel decoratedTabPanel = new DecoratedTabPanel();
    comunidadesPanel.add(decoratedTabPanel, 10, 10);
    decoratedTabPanel.setSize("958px", "500px");
   
    AbsolutePanel absolutePanel_9 = new AbsolutePanel();
    decoratedTabPanel.add(absolutePanel_9, "Listado de comunidades", false);
    decoratedTabPanel.selectTab(0);
    absolutePanel_9.setSize("946px", "458px");
   
    AbsolutePanel absolutePanel_10 = new AbsolutePanel();
    decoratedTabPanel.add(absolutePanel_10, "Panoramas", false);
    absolutePanel_10.setSize("947px", "458px");
   
    AbsolutePanel absolutePanel_11 = new AbsolutePanel();
    decoratedTabPanel.add(absolutePanel_11, "Insertar ficha de comunidad", false);
    absolutePanel_11.setSize("948px", "460px");
   
    AbsolutePanel absolutePanel_12 = new AbsolutePanel();
    decoratedTabPanel.add(absolutePanel_12, "Mapa", false);
    absolutePanel_12.setSize("946px", "460px");
   
    AbsolutePanel absolutePanel_13 = new AbsolutePanel();
    decoratedTabPanel.add(absolutePanel_13, "Fotos", false);
    absolutePanel_13.setSize("947px", "462px");
   
    AbsolutePanel absolutePanel_14 = new AbsolutePanel();
    decoratedTabPanel.add(absolutePanel_14, "Bitacora", false);
    absolutePanel_14.setSize("948px", "462px");
   
    AbsolutePanel absolutePanel_2 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_2, "Eventos", false);
   
    AbsolutePanel absolutePanel_3 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_3, "Investigación", false);
   
    AbsolutePanel absolutePanel_4 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_4, "New Widget", false);
   
    AbsolutePanel absolutePanel_5 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_5, "Estadísticas", false);
   
    AbsolutePanel absolutePanel_6 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_6, "Vinculaciones", false);
   
    AbsolutePanel absolutePanel_7 = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel_7, "Documentos", false);
   
    AbsolutePanel absolutePanel = new AbsolutePanel();
    tabLayoutPanel.add(absolutePanel, "Inicio", false);
   
    tabLayoutPanel.selectTab(0);
   
   
   
    rootPanel.add(tabLayoutPanel, 0, 35);
   

   
        signInLink.getElement().setClassName("login-area");
        signInLink.setText("Iniciar Sesión");
        signInLink.setTitle("Click para finalizar sesión");
        loginImage.getElement().setClassName("login-area");
        loginPanel.add(signInLink);
        RootPanel.get("loginPanelContainer").add(loginPanel);
        final StringBuilder userEmail = new StringBuilder();
        greetingService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>() {
            @Override
            public void onFailure(final Throwable caught) {
                GWT.log("login -> onFailure");
            }

            @Override
            public void onSuccess(final LoginInfo result) {
                if (result.getName() != null && !result.getName().isEmpty()) {
                    addGoogleAuthHelper();
                    loadLogout(result);
                } else {
                    loadLogin(result);
                }
                userEmail.append(result.getEmailAddress());
               
               
               
               
            }
        });
   
   

    // Click handler for showing the Comunidades panel
    btnComunidades.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
       
        if ( ! comunidadesPanel.isVisible() ){
         
          comunidadesPanel.setVisible(true);
          btnFamilias.setDown(false);
          btnComunidades.setDown(true);
       
        }
        else {
         
          comunidadesPanel.setVisible(false);
          btnFamilias.setDown(true);
          btnComunidades.setDown(false);
        }
      }
    });
View Full Code Here

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

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

      tab.setTitle(tip);
    return tab;
  }
 
  public ToggleButton createButton(String labelUp, String labelDown, String tip, boolean html) {
      ToggleButton tab = createButton(labelUp, tip, false);
     
      if(html) {
          tab.getDownFace().setHTML(labelDown);
    }
    else {
        tab.getDownFace().setText(labelDown);
    }
     
    return tab;
  }
View Full Code Here

  private Widget getTabWidget(I index, boolean isUiAdd) {

    final String labelText = isUiAdd ? ("-New " + getIndexTypeName() + "-") : getInstanceName(index);

    if(enableDelete || isUiAdd) {
      final ToggleButton btnDeleteTgl =
        new ToggleButton(imageBundle.delete().createImage(), imageBundle.undo().createImage());
      btnDeleteTgl.addStyleName(Styles.DELETE_BUTTON);
      btnDeleteTgl.setTitle("Delete " + labelText);
      btnDeleteTgl.getElement().setPropertyBoolean(UI_ADD, isUiAdd);
      btnDeleteTgl.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
          if(Element.as(event.getNativeEvent().getEventTarget()).getPropertyBoolean(UI_ADD)) {
            remove(tabPanel.getTabBar().getSelectedTab(), true);
          }
          else {
            markDeleted(tabPanel.getTabBar().getSelectedTab(), btnDeleteTgl.isDown());
            assert event.getSource() == btnDeleteTgl;
            btnDeleteTgl.setTitle(btnDeleteTgl.isDown() ? "Un-delete " + labelText : "Delete " + labelText);
          }
        }
      });

      final Toolbar t = new Toolbar();
View Full Code Here

    }
  }

  @Override
  protected void markDeleted(int index, boolean deleted) throws IndexOutOfBoundsException {
    final ToggleButton tb = (ToggleButton) ((Toolbar) tabWidgets.get(index)).getWidget(0);
    tb.setTitle((deleted ? "Un-delete " : "Delete ") + getIndexTypeName());
    tb.setDown(deleted)// in case this method was invoked programatically
    super.markDeleted(index, deleted);
  }
View Full Code Here

    p.getHoverBar().setPixelSize(100, 100);
    p.setCollapsedState(true);
    RootPanel.get().add(p);
 
    // Hook a toggle button.
    p.hookupControlToggle(new ToggleButton("Toggle"));
 
    // Fire an event on the hover bar.
    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

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.