Package com.extjs.gxt.ui.client.event

Examples of com.extjs.gxt.ui.client.event.ButtonEvent


    }
  }

  @Override
  protected ComponentEvent createComponentEvent(Event event) {
    return new ButtonEvent(this);
  }
View Full Code Here


  protected void onClick(ComponentEvent ce) {
    ce.preventDefault();
    focus();
    hideToolTip();
    if (!disabled) {
      ButtonEvent be = new ButtonEvent(this);
      if (!fireEvent(Events.BeforeSelect, be)) {
        return;
      }
      if (menu != null && !menu.isVisible()) {
        showMenu();
View Full Code Here

  }

  protected void onMenuHide(ComponentEvent ce) {
    removeStyleName(baseStyle + "-menu-active");

    ButtonEvent be = new ButtonEvent(this);
    be.setMenu(menu);
    fireEvent(Events.MenuHide, be);
    focus();
  }
View Full Code Here

  }

  protected void onMenuShow(ComponentEvent ce) {
    addStyleName(baseStyle + "-menu-active");

    ButtonEvent be = new ButtonEvent(this);
    be.setMenu(menu);
    fireEvent(Events.MenuShow, be);

    if (GXT.isFocusManagerEnabled()) {
      if (menu.getItemCount() > 0) {
        menu.setActiveItem(menu.getItem(0), false);
View Full Code Here

  protected void onClick(ComponentEvent ce) {
    ce.preventDefault();
    focus();
    hideToolTip();
    if (!disabled) {
      ButtonEvent be = new ButtonEvent(this);
      be.setEvent(ce.getEvent());
      if (isClickOnArrow(ce)) {
        if (menu != null && !menu.isVisible()) {
          showMenu();
        }
        be.setMenu(menu);
        fireEvent(Events.ArrowClick, be);
      } else {
        fireEvent(Events.Select, be);
      }
    }
View Full Code Here

        toggle();
      }
      if (menu != null && !menu.isVisible()) {
        showMenu();
      }
      ButtonEvent be = new ButtonEvent(this);
      be.setEvent(ce.getEvent());
      fireEvent(Events.Select, be);
    }
  }
View Full Code Here

   * @param silent true to not fire the toggle event
   */
  protected void toggle(boolean state, boolean silent) {
    this.pressed = state;
    if (rendered) {
      ButtonEvent be = new ButtonEvent(this);
      if (state) {
        addStyleName(baseStyle + "-pressed");
        removeStyleName(baseStyle + "-over");
        removeStyleName(baseStyle + "-blur");
      } else {
View Full Code Here

      }
      item.addSelectionListener(new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
          ButtonEvent e = new ButtonEvent(sb);
          e.setEvent(ce.getEvent());
          sb.fireEvent(Events.Select, e);
        }

      });
      menu.add(item);

    } else if (c instanceof Button) {
      final Button b = (Button) c;
      MenuItem item = new MenuItem(b.getHtml(), b.getIcon());
      item.setItemId(c.getItemId());

      if (b.getData("gxt-menutext") != null) {
        item.setHtml(b.getData("gxt-menutext").toString());
      }
      if (b.getMenu() != null) {
        item.setHideOnClick(false);
        item.setSubMenu(b.getMenu());
      }
      item.setEnabled(c.isEnabled());
      item.addSelectionListener(new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
          ButtonEvent e = new ButtonEvent(b);
          e.setEvent(ce.getEvent());
          b.fireEvent(Events.Select, e);
        }

      });
      menu.add(item);
View Full Code Here

   * Hide this button's menu (if it has one).
   */
  public void hideMenu() {
    if (menu != null) {
      menu.hide();
      ButtonEvent be = new ButtonEvent(this);
      be.menu = menu;
      fireEvent(Events.MenuHide, be);
    }
  }
View Full Code Here

  @Override
  public void onComponentEvent(ComponentEvent ce) {
    Element source = ce.component.getElement();
    ce.stopEvent();
    super.onComponentEvent(ce);
    ButtonEvent be = (ButtonEvent) ce;
    switch (ce.type) {
      case Event.ONMOUSEOVER:
        Element from = DOM.eventGetFromElement(ce.event);
        if (from != null && !DOM.isOrHasChild(source, from)) {
          onMouseEnter(ce);
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.event.ButtonEvent

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.