Package com.vaadin.browserless.internal
Class GridContextMenuSupport
-
- All Implemented Interfaces:
public final class GridContextMenuSupportHelpers for driving a GridContextMenu the way the grid's client-side connector does.
For internal use only.
- Since:
25.3
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringBEFORE_OPEN_EVENTpublic final static StringTARGET_ITEM_KEY_PROPERTYpublic final static StringTARGET_COLUMN_ID_PROPERTY
-
Method Summary
Modifier and Type Method Description static GridContextMenu<out Object>getContextMenu(Grid<out Object> grid)Gets the context menu added to the given grid. static voidsetTargetItem(Grid<out Object> grid, String itemKey, String columnInternalId)Records the row and column the context menu is about, the way the grid does when the browser reports a context menu gesture. static <Y> StringgetItemKey(Grid<Y> grid, Y item)Gets the key the grid uses for the given item. static StringgetColumnInternalId(Grid<out Object> grid, String columnKey)Gets the internal id the grid uses for the column with the given key. -
-
Method Detail
-
getContextMenu
static GridContextMenu<out Object> getContextMenu(Grid<out Object> grid)
Gets the context menu added to the given grid.
A grid keeps no reference to its context menu, and the menu is not part of the component tree until it opens, so the only link from the grid back to the menu is the listener the menu registers on the grid element for {@value #BEFORE_OPEN_EVENT}.
- Parameters:
grid- the grid whose context menu to get- Returns:
the context menu of the grid
-
setTargetItem
static void setTargetItem(Grid<out Object> grid, String itemKey, String columnInternalId)
Records the row and column the context menu is about, the way the grid does when the browser reports a context menu gesture.
- Parameters:
grid- the grid the menu is attached toitemKey- key of the row the menu targets, or null for nonecolumnInternalId- internal id of the column the menu targets, or null for none
-
getItemKey
static <Y> String getItemKey(Grid<Y> grid, Y item)
Gets the key the grid uses for the given item.
- Parameters:
grid- the grid holding the itemitem- the item to get the key for- Returns:
the key of the item
-
getColumnInternalId
static String getColumnInternalId(Grid<out Object> grid, String columnKey)
Gets the internal id the grid uses for the column with the given key.
- Parameters:
grid- the grid holding the columncolumnKey- the key of the column, as set withGrid.Column.setKey(String)- Returns:
the internal id of the column
-
-
-
-