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

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

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

Button.removeShortcutListener介绍

暂无

代码示例

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

/**
 * Removes the keyboard shortcut previously set with
 * {@link #setClickShortcut(int, int...)}.
 */
public void removeClickShortcut() {
  if (clickShortcut != null) {
    removeShortcutListener(clickShortcut);
    clickShortcut = null;
    getState().clickShortcutKeyCode = 0;
  }
}

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

/**
 * Makes it possible to invoke a click on this button by pressing the given
 * {@link KeyCode} and (optional) {@link ModifierKey}s.<br/>
 * The shortcut is global (bound to the containing Window).
 *
 * @param keyCode
 *            the keycode for invoking the shortcut
 * @param modifiers
 *            the (optional) modifiers for invoking the shortcut, null for
 *            none
 */
public void setClickShortcut(int keyCode, int... modifiers) {
  if (clickShortcut != null) {
    removeShortcutListener(clickShortcut);
  }
  clickShortcut = new ClickShortcut(this, keyCode, modifiers);
  addShortcutListener(clickShortcut);
  getState().clickShortcutKeyCode = clickShortcut.getKeyCode();
}

代码示例来源:origin: de.mhus.lib/mhu-lib-vaadin

@Override
  public void buttonClick(ClickEvent event) {
    
    if ("".equals(password.getValue())) {
      password.focus();
      return;
    }
    
    error.setCaption("");
    
    if (listener != null && listener.doLogin(username.getValue(),password.getValue())) {
      signin.removeShortcutListener(enter);
    } else {
      // Add new error message
      error.setCaption(MNls.find(LoginPanel.this, "login.error=Wrong username or password."));
      username.focus();
    }
  }
});

相关文章