com.vaadin.flow.component.
Interface ClickNotifier<T extends Component>
-
Type Parameters:
T
- the type of the component returned at theComponentEvent.getSource()
All Superinterfaces:
All Known Implementing Classes:
Article
,Aside
,Button
,Checkbox
,ContextMenu
,ContextMenuBase
,DescriptionList
,DescriptionList.Description
,DescriptionList.Term
,Div
,DrawerToggle
,Emphasis
,FlexLayout
,Footer
,FormLayout
,FormLayout.FormItem
,GeneratedVaadinButton
,GeneratedVaadinCheckbox
,GeneratedVaadinContextMenu
,GeneratedVaadinFormItem
,GeneratedVaadinRadioButton
,GeneratedVaadinSplitLayout
,GridContextMenu
,H1
,H2
,H3
,H4
,H5
,H6
,Header
,HorizontalLayout
,HtmlObject
,Icon
,Image
,IronIcon
,ItemFilter
,ListItem
,Main
,MenuItem
,NativeButton
,NativeDetails
,NativeDetails.Summary
,Nav
,OrderedList
,Paragraph
,Pre
,Section
,Span
,SplitLayout
,UnorderedList
,VerticalLayout
public interface ClickNotifier<T extends Component> extends Serializable
Mixin interface for components that support adding click listeners to the their root elements.
Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method 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 implementsClickNotifier
interface.
-
-
-
Method Detail
-
addClickListener
default Registration addClickListener(ComponentEventListener<ClickEvent<T>> listener)
Adds a click listener to this component.
Parameters:
listener
- the listener to add, notnull
Returns:
a handle that can be used for removing the listener
-
addClickShortcut
default ShortcutRegistration addClickShortcut(Key key, KeyModifier... keyModifiers)
Adds a shortcut which 'clicks' the
Component
which implementsClickNotifier
interface. The shortcut's event listener is in global scope and the shortcut's lifecycle is tied tothis
component.Use the returned
ShortcutRegistration
to fluently configure the shortcut.By default, the returned
ShortcutRegistration
allows browser's default behavior, unlike otherShortcutRegistrations
. 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, callShortcutRegistration.setBrowserDefaultAllowed(boolean)
.Parameters:
key
- primaryKey
used to trigger the shortcut. Cannot be null.keyModifiers
-KeyModifiers
that need to be pressed along with thekey
for the shortcut to triggerReturns:
ShortcutRegistration
for configuring the shortcut and removing
-
-