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 classNested 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 booleanonBeforeOpenMenu(elemental.json.JsonObject eventDetail) voidsetDynamicContentHandler(com.vaadin.flow.function.SerializablePredicate<com.vaadin.flow.component.tabs.Tab> dynamicContentHandler) Sets a callback that is executed before the context menu is opened.voidsetTarget(com.vaadin.flow.component.Component target) Methods inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
add, add, add, addComponent, addComponent, addComponentAsFirst, addComponentAtIndex, addItem, addItem, addOpenedChangeListener, addSeparator, close, getChildren, getItems, isOpened, isOpenOnClick, remove, removeAll, setOpenOnClickMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
removeMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods 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:HasMainTabSheetMenuItemsAdds a new item component with the given text content and click listener to the context menu overlay.- Specified by:
addItemin interfaceHasMainTabSheetMenuItems- Parameters:
text- the text content for the new itemclickListener- the handler for clicking the new item, can benullto not add listener- Returns:
- the added
MainTabSheetMenuItemcomponent
-
addItem
public MainTabSheetMenuItem addItem(com.vaadin.flow.component.Component component, @Nullable com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener) Description copied from interface:HasMainTabSheetMenuItemsAdds a new item component with the given component and click listener to the context menu overlay.- Specified by:
addItemin interfaceHasMainTabSheetMenuItems- Parameters:
component- the component inside the new itemclickListener- the handler for clicking the new item, can benullto not add listener- Returns:
- the added
MainTabSheetMenuItemcomponent
-
setTarget
public void setTarget(com.vaadin.flow.component.Component target) - Overrides:
setTargetin classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,MainTabSheetMenuItem, MainTabSheetSubMenu>
-
getTarget
- Overrides:
getTargetin 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
nullif 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:
onBeforeOpenMenuin 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:
createMenuManagerin classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,MainTabSheetMenuItem, MainTabSheetSubMenu>
-
getMenuManager
protected JmixMenuManager<MainTabSheetContextMenu,MainTabSheetMenuItem, getMenuManager()MainTabSheetSubMenu> - Overrides:
getMenuManagerin classcom.vaadin.flow.component.contextmenu.ContextMenuBase<MainTabSheetContextMenu,MainTabSheetMenuItem, MainTabSheetSubMenu>
-