Class JmixGridContextMenu<E>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.contextmenu.ContextMenuBase<com.vaadin.flow.component.grid.contextmenu.GridContextMenu<T>,com.vaadin.flow.component.grid.contextmenu.GridMenuItem<T>,com.vaadin.flow.component.grid.contextmenu.GridSubMenu<T>>
com.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>
io.jmix.flowui.kit.component.grid.JmixGridContextMenu<E>
- Type Parameters:
E
- the grid item type
- 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
,HasSubParts
,Serializable
public class JmixGridContextMenu<E>
extends com.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>
implements HasSubParts
A custom implementation of a context menu for a
Grid
component that extends
the GridContextMenu
functionality and implements the HasSubParts
interface.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.contextmenu.GridContextMenu
com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<T extends Object>, com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuOpenedEvent<T extends Object>
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
Fields inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
EVENT_DETAIL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>
addItemAtIndex
(int index, com.vaadin.flow.component.Component component) Adds a menu item at the specified index with the provided component.com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>
addItemAtIndex
(int index, com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<E>> clickListener) Adds a menu item at the specified index with the provided component and associates it with a click listener if provided.com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>
addItemAtIndex
(int index, String text) Adds a menu item at the specified index with the given text.com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>
addItemAtIndex
(int index, String text, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<E>> clickListener) Adds a menu item at the specified index with the given text and associates it with a click listener if provided.protected com.vaadin.flow.component.contextmenu.MenuManager<com.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>,
com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>, com.vaadin.flow.component.grid.contextmenu.GridSubMenu<E>> createMenuManager
(com.vaadin.flow.function.SerializableRunnable contentReset) protected com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>
findMenuItemByFullPathRecursive
(Collection<com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>> childItems, String[] ids) Performs recursive search for a menu item by id path parts (for example: ["cm1", "menu1", "item2"])protected com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>
findMenuItemByIdRecursive
(Collection<com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>> childItems, String id) Performs recursive search for a menu item by single id (for example: "item2")protected JmixMenuManager<com.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>,
com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>, com.vaadin.flow.component.grid.contextmenu.GridSubMenu<E>> getSubPart
(String name) Returns a sub part object by its name.Methods inherited from class com.vaadin.flow.component.grid.contextmenu.GridContextMenu
addGridContextMenuOpenedListener, addItem, addItem, getDynamicContentHandler, onBeforeOpenMenu, setDynamicContentHandler, setTarget
Methods inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
add, addComponentAtIndex, addItem, addItem, addOpenedChangeListener, close, getChildren, getItems, getTarget, 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
-
Constructor Details
-
JmixGridContextMenu
public JmixGridContextMenu() -
JmixGridContextMenu
-
-
Method Details
-
addItemAtIndex
public com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E> addItemAtIndex(int index, String text) Adds a menu item at the specified index with the given text. If the index is equal to the current number of items, the menu item will be appended to the end of the menu. Otherwise, the item will be inserted at the specified index.- Parameters:
index
- the position at which the menu item should be addedtext
- the text for the menu item- Returns:
- the newly created menu item
-
addItemAtIndex
public com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E> addItemAtIndex(int index, String text, @Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<E>> clickListener) Adds a menu item at the specified index with the given text and associates it with a click listener if provided. If the index is equal to the current number of items, the menu item will be appended to the end of the menu. Otherwise, the item will be inserted at the specified index.- Parameters:
index
- the position at which the menu item should be addedtext
- the text for the menu itemclickListener
- the click listener to associate with the menu item, may be null- Returns:
- the newly created menu item
-
addItemAtIndex
public com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E> addItemAtIndex(int index, com.vaadin.flow.component.Component component) Adds a menu item at the specified index with the provided component. If the index is equal to the current number of items, the menu item will be appended to the end. Otherwise, the item will be inserted at the specified index.- Parameters:
index
- the position at which the menu item should be addedcomponent
- the component to be associated with the menu item- Returns:
- the newly created menu item
-
addItemAtIndex
public com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E> addItemAtIndex(int index, com.vaadin.flow.component.Component component, @Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<E>> clickListener) Adds a menu item at the specified index with the provided component and associates it with a click listener if provided. If the index is equal to the current number of items, the menu item will be appended to the end of the menu. Otherwise, the item will be inserted at the specified index.- Parameters:
index
- the position at which the menu item should be addedcomponent
- the component to be associated with the menu itemclickListener
- the click listener to associate with the menu item; may be null- Returns:
- the newly created menu item
-
createMenuManager
protected com.vaadin.flow.component.contextmenu.MenuManager<com.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>,com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>, createMenuManagercom.vaadin.flow.component.grid.contextmenu.GridSubMenu<E>> (com.vaadin.flow.function.SerializableRunnable contentReset) - Overrides:
createMenuManager
in classcom.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>
-
getMenuManager
protected JmixMenuManager<com.vaadin.flow.component.grid.contextmenu.GridContextMenu<E>,com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>, getMenuManager()com.vaadin.flow.component.grid.contextmenu.GridSubMenu<E>> -
getSubPart
Description copied from interface:HasSubParts
Returns a sub part object by its name.- Specified by:
getSubPart
in interfaceHasSubParts
- Parameters:
name
- sub part name, e.g. component id- Returns:
- a menu item with id matching the name if exists.
-
findMenuItemByIdRecursive
@Nullable protected com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E> findMenuItemByIdRecursive(Collection<com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>> childItems, String id) Performs recursive search for a menu item by single id (for example: "item2") -
findMenuItemByFullPathRecursive
@Nullable protected com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E> findMenuItemByFullPathRecursive(Collection<com.vaadin.flow.component.grid.contextmenu.GridMenuItem<E>> childItems, String[] ids) Performs recursive search for a menu item by id path parts (for example: ["cm1", "menu1", "item2"])
-