L - Menu item click listener typeM - Concrete ContextMenu component typeI - Menu item typeS - Sub menu typeC - Concrete configurator typepublic interface ContextMenuConfigurator<L extends EventListener,M extends com.vaadin.flow.component.contextmenu.ContextMenuBase<M,I,S>,I extends com.vaadin.flow.component.contextmenu.MenuItemBase<M,I,S>,S extends com.vaadin.flow.component.contextmenu.SubMenuBase<M,I,S>,C extends ContextMenuConfigurator<L,M,I,S,C>> extends ComponentConfigurator<C>, HasStyleConfigurator<C>
ContextMenu component configurator.| Modifier and Type | Interface and Description |
|---|---|
static interface |
ContextMenuConfigurator.MenuItemBuilder<L extends EventListener,M extends com.vaadin.flow.component.contextmenu.ContextMenuBase<M,I,S>,I extends com.vaadin.flow.component.contextmenu.MenuItemBase<M,I,S>,S extends com.vaadin.flow.component.contextmenu.SubMenuBase<M,I,S>,B extends ContextMenuConfigurator<L,M,I,S,B>>
Context menu item configurator.
|
ComponentConfigurator.BaseComponentConfigurator| Modifier and Type | Method and Description |
|---|---|
C |
openOnClick(boolean openOnClick)
Determines the way for opening the context menu.
|
ContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> |
withItem(com.vaadin.flow.component.Component component)
Create a new menu item with the given component inside.
|
default C |
withItem(com.vaadin.flow.component.Component component,
L clickEventListener)
Add a new menu item with the given component inside and a
ClickEventListener for menu item clicks. |
ContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> |
withItem(com.holonplatform.core.i18n.Localizable text)
Create a new menu item with the given localizable text content.
|
default C |
withItem(com.holonplatform.core.i18n.Localizable text,
L clickEventListener)
Add a new menu item using given localizable text content and a
ClickEventListener for menu item clicks. |
default ContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> |
withItem(String text)
Create a new menu item with the given text content.
|
default C |
withItem(String text,
L clickEventListener)
Add a new menu item using given text content and a
ClickEventListener for menu item clicks. |
default C |
withItem(String defaultText,
String messageCode,
L clickEventListener)
Add a new menu item using given
messageCode for text localization and a ClickEventListener
for menu item clicks. |
default ContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> |
withItem(String defaultText,
String messageCode,
Object... arguments)
Create a new menu item using given
messageCode for text content localization. |
C |
withOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.contextmenu.GeneratedVaadinContextMenu.OpenedChangeEvent<M>> listener)
Adds a listener to be notified when the context menu is opened or closed.
|
elementConfiguration, hidden, id, visible, withAttachListener, withDetachListenerwithEventListener, withEventListener, withThemeNamestyleName, styleNamesContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> withItem(com.holonplatform.core.i18n.Localizable text)
The ContextMenuConfigurator.MenuItemBuilder.add() method can be used to add the item to the context menu.
text - Localizable menu item text contentContextMenuConfigurator.MenuItemBuilder to configure and add the menu itemLocalizationProviderdefault ContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> withItem(String text)
The ContextMenuConfigurator.MenuItemBuilder.add() method can be used to add the item to the context menu.
text - Menu item text contentContextMenuConfigurator.MenuItemBuilder to configure and add the menu itemdefault ContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> withItem(String defaultText, String messageCode, Object... arguments)
messageCode for text content localization.
The ContextMenuConfigurator.MenuItemBuilder.add() method can be used to add the item to the context menu.
defaultText - Default menu item text content if no translation is available for given
messageCode.messageCode - Menu item text content translation message keyarguments - Optional translation argumentsContextMenuConfigurator.MenuItemBuilder to configure and add the menu itemLocalizationProviderContextMenuConfigurator.MenuItemBuilder<L,M,I,S,C> withItem(com.vaadin.flow.component.Component component)
The ContextMenuConfigurator.MenuItemBuilder.add() method can be used to add the item to the context menu.
component - The menu item component (not null)ContextMenuConfigurator.MenuItemBuilder to configure and add the menu itemdefault C withItem(com.holonplatform.core.i18n.Localizable text, L clickEventListener)
ClickEventListener for menu item clicks.text - Menu item text contentclickEventListener - The listener to use to listen to menu item clicks (not null)LocalizationProviderdefault C withItem(String defaultText, String messageCode, L clickEventListener)
messageCode for text localization and a ClickEventListener
for menu item clicks.defaultText - Default menu item text content if no translation is available for given
messageCode.messageCode - Menu item text content translation message keyclickEventListener - The listener to use to listen to menu item clicks (not null)LocalizationProviderdefault C withItem(String text, L clickEventListener)
ClickEventListener for menu item clicks.text - Menu item text contentclickEventListener - The listener to use to listen to menu item clicks (not null)default C withItem(com.vaadin.flow.component.Component component, L clickEventListener)
ClickEventListener for menu item clicks.component - The menu item component (not null)clickEventListener - The listener to use to listen to menu item clicks (not null)C openOnClick(boolean openOnClick)
By default, the context menu can be opened with a right click or a long touch on the target component.
openOnClick - if true, the context menu can be opened with left click only. Otherwise the
context menu follows the default behavior.C withOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.contextmenu.GeneratedVaadinContextMenu.OpenedChangeEvent<M>> listener)
listener - the listener to addCopyright © 2019 The Holon Platform. All rights reserved.