Class MainTabSheetContextMenu
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,MainTabSheetMenuItem,MainTabSheetSubMenu>
io.jmix.tabbedmode.component.tabsheet.contextmenu.MainTabSheetContextMenu
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasComponents
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasStyle
,HasMainTabSheetMenuItems
,Serializable
public class MainTabSheetContextMenu
extends com.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,MainTabSheetMenuItem,MainTabSheetSubMenu>
implements HasMainTabSheetMenuItems
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
com.vaadin.flow.component.contextmenu.ContextMenuBase.OpenedChangeEvent<TComponent extends com.vaadin.flow.component.contextmenu.ContextMenuBase<TComponent,
?, ?>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab>
Fields inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
EVENT_DETAIL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItem
(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) Adds a new item component with the given component and click listener to the context menu overlay.addItem
(String text, com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) Adds a new item component with the given text content and click listener to the context menu overlay.addItemAtIndex
(int index, com.vaadin.flow.component.Component component) addItemAtIndex
(int index, com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) addItemAtIndex
(int index, String text) addItemAtIndex
(int index, String text, com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) protected com.vaadin.flow.component.contextmenu.MenuManager<MainTabSheetContextMenu,
MainTabSheetMenuItem, MainTabSheetSubMenu> createMenuManager
(com.vaadin.flow.function.SerializableRunnable contentReset) com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab>
Gets the callback function that is executed before the context menu is opened.protected boolean
onBeforeOpenMenu
(elemental.json.JsonObject eventDetail) void
setDynamicContentHandler
(com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab> dynamicContentHandler) Sets a callback that is executed before the context menu is opened.void
setTarget
(com.vaadin.flow.component.Component target) Methods inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
add, addComponentAtIndex, addItem, addItem, addOpenedChangeListener, close, getChildren, getItems, isOpened, isOpenOnClick, remove, removeAll, setOpenOnClick
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, remove
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
dynamicContentHandler
protected com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab> dynamicContentHandler
-
-
Constructor Details
-
MainTabSheetContextMenu
public MainTabSheetContextMenu() -
MainTabSheetContextMenu
-
-
Method Details
-
addItemAtIndex
-
addItemAtIndex
public MainTabSheetMenuItem addItemAtIndex(int index, String text, @Nullable com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) -
addItemAtIndex
public MainTabSheetMenuItem addItemAtIndex(int index, com.vaadin.flow.component.Component component) -
addItemAtIndex
public MainTabSheetMenuItem addItemAtIndex(int index, com.vaadin.flow.component.Component component, @Nullable com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) -
addItem
public MainTabSheetMenuItem addItem(String text, @Nullable com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) Description copied from interface:HasMainTabSheetMenuItems
Adds a new item component with the given text content and click listener to the context menu overlay.- Specified by:
addItem
in interfaceHasMainTabSheetMenuItems
- Parameters:
text
- the text content for the new itemclickListener
- the handler for clicking the new item, can benull
to not add listener- Returns:
- the added
MainTabSheetMenuItem
component
-
addItem
public MainTabSheetMenuItem addItem(com.vaadin.flow.component.Component component, @Nullable com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) Description copied from interface:HasMainTabSheetMenuItems
Adds a new item component with the given component and click listener to the context menu overlay.- Specified by:
addItem
in interfaceHasMainTabSheetMenuItems
- Parameters:
component
- the component inside the new itemclickListener
- the handler for clicking the new item, can benull
to not add listener- Returns:
- the added
MainTabSheetMenuItem
component
-
setTarget
public void setTarget(com.vaadin.flow.component.Component target) - Overrides:
setTarget
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,
MainTabSheetMenuItem, MainTabSheetSubMenu>
-
getTarget
- Overrides:
getTarget
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,
MainTabSheetMenuItem, MainTabSheetSubMenu>
-
getDynamicContentHandler
@Nullable public com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab> getDynamicContentHandler()Gets the callback function that is executed before the context menu is opened.The dynamic context handler allows for customizing the contents of the context menu before it is open.
- Returns:
- the callback function that is executed before opening the context
menu, or
null
if not specified.
-
setDynamicContentHandler
public void setDynamicContentHandler(@Nullable com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab> dynamicContentHandler) Sets a callback that is executed before the context menu is opened.This callback receives the clicked item (if any) as an input parameter and further can dynamically modify the contents of the context menu. This is useful in situations where the context menu items cannot be known in advance and depend on the specific context (i.e. clicked row) and thus can be configured dynamically. The boolean return value of this callback specifies if the context menu will be opened.
- Parameters:
dynamicContentHandler
- the callback function that will be executed before opening the context menu.
-
onBeforeOpenMenu
protected boolean onBeforeOpenMenu(elemental.json.JsonObject eventDetail) - Overrides:
onBeforeOpenMenu
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,
MainTabSheetMenuItem, MainTabSheetSubMenu>
-
createMenuManager
protected com.vaadin.flow.component.contextmenu.MenuManager<MainTabSheetContextMenu,MainTabSheetMenuItem, createMenuManagerMainTabSheetSubMenu> (com.vaadin.flow.function.SerializableRunnable contentReset) - Specified by:
createMenuManager
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,
MainTabSheetMenuItem, MainTabSheetSubMenu>
-
getMenuManager
protected JmixMenuManager<MainTabSheetContextMenu,MainTabSheetMenuItem, getMenuManager()MainTabSheetSubMenu> - Overrides:
getMenuManager
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,
MainTabSheetMenuItem, MainTabSheetSubMenu>
-