Package com.vaadin.flow.component
Interface KeyNotifier
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractNumberField,BigDecimalField,EmailField,IntegerField,NumberField,PasswordField,RichTextEditor,TextArea,TextField
public interface KeyNotifier extends Serializable
Mixin interface for components that support adding key event listeners to the their root elements.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default RegistrationaddKeyDownListener(ComponentEventListener<KeyDownEvent> listener)Adds akeydownlistener to this component.default RegistrationaddKeyDownListener(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers)Adds akeydownlistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.default RegistrationaddKeyPressListener(ComponentEventListener<KeyPressEvent> listener)Adds akeypresslistener to this component.default RegistrationaddKeyPressListener(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers)Adds akeypresslistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.default RegistrationaddKeyUpListener(ComponentEventListener<KeyUpEvent> listener)Adds akeyuplistener to this component.default RegistrationaddKeyUpListener(Key key, ComponentEventListener<KeyUpEvent> listener, KeyModifier... modifiers)Adds akeyuplistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.
-
-
-
Method Detail
-
addKeyDownListener
default Registration addKeyDownListener(ComponentEventListener<KeyDownEvent> listener)
Adds akeydownlistener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addKeyPressListener
default Registration addKeyPressListener(ComponentEventListener<KeyPressEvent> listener)
Adds akeypresslistener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addKeyUpListener
default Registration addKeyUpListener(ComponentEventListener<KeyUpEvent> listener)
Adds akeyuplistener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addKeyDownListener
default Registration addKeyDownListener(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers)
Adds akeydownlistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.See
Keyfor common static instances or useKey.of(String, String...)to get an instance from an arbitrary value.- Parameters:
key- the key to matchlistener- the listener to add, notnullmodifiers- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-
addKeyPressListener
default Registration addKeyPressListener(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers)
Adds akeypresslistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.See
Keyfor common static instances or useKey.of(String, String...)to get an instance from an arbitrary value.- Parameters:
key- the key to matchlistener- the listener to add, notnullmodifiers- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-
addKeyUpListener
default Registration addKeyUpListener(Key key, ComponentEventListener<KeyUpEvent> listener, KeyModifier... modifiers)
Adds akeyuplistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.See
Keyfor common static instances or useKey.of(String, String...)to get an instance from an arbitrary value.- Parameters:
key- the key to matchlistener- the listener to add, notnullmodifiers- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-
-