T
- the type of the component returned at the
ComponentEvent.getSource()
public interface ClickNotifier<T extends Component> extends Serializable
Modifier and Type | Method and Description |
---|---|
default Registration |
addClickListener(ComponentEventListener<ClickEvent<T>> listener)
Adds a click listener to this component.
|
default ShortcutRegistration |
addClickShortcut(Key key,
KeyModifier... keyModifiers)
Adds a shortcut which 'clicks' the
Component which implements
ClickNotifier interface. |
default Registration addClickListener(ComponentEventListener<ClickEvent<T>> listener)
listener
- the listener to add, not null
default ShortcutRegistration addClickShortcut(Key key, KeyModifier... keyModifiers)
Component
which implements
ClickNotifier
interface. The shortcut's event listener is in
global scope and the shortcut's lifecycle is tied to this
component.
Use the returned ShortcutRegistration
to fluently configure the
shortcut.
By default, the returned ShortcutRegistration
allows browser's
default behavior, unlike other ShortcutRegistrations
. This is
used to make sure that value synchronization of input fields is not
blocked for the shortcut key (e.g. Enter key). To change this behavior,
call ShortcutRegistration.setBrowserDefaultAllowed(boolean)
.
key
- primary Key
used to trigger the shortcut. Cannot be
null.keyModifiers
- KeyModifiers
that need to be pressed along
with the key
for the shortcut to triggerShortcutRegistration
for configuring the shortcut and
removingCopyright © 2025. All rights reserved.