List of usage examples for com.vaadin.event ShortcutListener getCaption
public String getCaption()
From source file:com.haulmont.cuba.web.gui.components.WebFilterHelper.java
License:Apache License
@Override public void addShortcutListener(TextField textField, final ShortcutListener listener) { CubaTextField vTextField = textField.unwrap(CubaTextField.class); int[] modifiers = null; KeyCombination.Modifier[] listenerModifiers = listener.getKeyCombination().getModifiers(); if (listenerModifiers != null) { modifiers = new int[listenerModifiers.length]; for (int i = 0; i < modifiers.length; i++) { modifiers[i] = listenerModifiers[i].getCode(); }// w w w . j av a2s . c o m } int keyCode = listener.getKeyCombination().getKey().getCode(); vTextField.addShortcutListener( new com.vaadin.event.ShortcutListener(listener.getCaption(), keyCode, modifiers) { @Override public void handleAction(Object sender, Object target) { listener.handleShortcutPressed(); } }); }