com.vaadin.ui.Button.fireClick()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中com.vaadin.ui.Button.fireClick()方法的一些代码示例,展示了Button.fireClick()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.fireClick()方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:fireClick

Button.fireClick介绍

[英]Fires a click event to all listeners without any event details.

In subclasses, override #fireClick(MouseEventDetails) instead of this method.
[中]向所有侦听器激发一个单击事件,而不显示任何事件详细信息。
在子类中,重写#fireClick(MouseEventDetails)而不是此方法。

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

@Override
public void click(MouseEventDetails mouseEventDetails) {
  fireClick(mouseEventDetails);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Simulates a button click, notifying all server-side listeners.
 * <p>
 * No action is taken if the button is disabled.
 */
public void click() {
  if (isEnabled()) {
    fireClick();
  }
}

代码示例来源:origin: viritin/viritin

@Override
protected void fireClick(MouseEventDetails details) {
  super.fireClick(details);
  if (mClickListeners != null) {
    final MClickListener[] array = mClickListeners.toArray(
        new MClickListener[mClickListeners.size()]);
    for (MClickListener l : array) {
      l.onClick();
    }
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-widgets

@Override
protected void fireClick() {
  // check if it cannot be clicked at all due to modal dialogs
  CubaUI ui = (CubaUI) getUI();
  if (ui.isAccessibleForUser(this)) {
    if (clickHandler != null) {
      clickHandler.accept(null);
    } else {
      super.fireClick();
    }
  } else {
    LoggerFactory.getLogger(CubaButton.class)
        .debug("Ignore click because button is inaccessible for user");
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-widgets

@Override
protected void fireClick(MouseEventDetails details) {
  // check if it cannot be clicked at all due to modal dialogs
  CubaUI ui = (CubaUI) getUI();
  if (ui.isAccessibleForUser(this)) {
    try {
      if (clickHandler != null) {
        clickHandler.accept(details);
      } else {
        super.fireClick(details);
      }
    } finally {
      if (getState(false).useResponsePending) {
        getRpcProxy(CubaButtonClientRpc.class).onClickHandled();
      }
    }
  } else {
    LoggerFactory.getLogger(CubaButton.class)
        .debug("Ignore click because button is inaccessible for user");
  }
}

相关文章