Class GridMenuItemActionWrapper<T>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
io.jmix.flowui.kit.component.grid.GridMenuItemActionWrapper<T>
- Type Parameters:
T- the type of the grid menu item's data
- 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,com.vaadin.flow.component.HasText,com.vaadin.flow.component.shared.HasPrefix,com.vaadin.flow.component.shared.HasSuffix,com.vaadin.flow.component.shared.HasTooltip,HasAction,Serializable
- Direct Known Subclasses:
GridContextMenuItemComponent
public class GridMenuItemActionWrapper<T>
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
implements com.vaadin.flow.component.HasText, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTooltip, HasAction
A wrapper class for encapsulating a grid menu item with associated actions and UI components.
This class represents a composite UI component, enabling the addition of text, prefix, suffix,
tooltip, and action functionality to a grid menu item.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
com.vaadin.flow.component.HasText.WhiteSpace -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GridMenuItemActionSupportprotected static final Stringprotected com.vaadin.flow.component.grid.contextmenu.GridMenuItem<T>protected static final Stringprotected com.vaadin.flow.component.Componentprotected static final Stringprotected com.vaadin.flow.component.Componentprotected static final Stringprotected com.vaadin.flow.component.html.Spanprotected com.vaadin.flow.component.shared.Tooltip -
Constructor Summary
ConstructorsConstructorDescriptionGridMenuItemActionWrapper(com.vaadin.flow.component.grid.contextmenu.GridMenuItem<T> menuItem) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.vaadin.flow.component.Component... components) voidvoidaddComponentAsFirst(com.vaadin.flow.component.Component component) voidaddComponentAtIndex(int index, com.vaadin.flow.component.Component component) com.vaadin.flow.shared.RegistrationaddMenuItemClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener) Adds a listener for click events on a menu item within the grid's context menu.protected GridMenuItemActionSupportReturns theGridMenuItemActionSupportinstance associated with this wrapper.com.vaadin.flow.component.grid.contextmenu.GridMenuItem<T>Returns the associated menu item of typeGridMenuItem.com.vaadin.flow.component.Componentcom.vaadin.flow.component.ComponentgetText()com.vaadin.flow.component.shared.Tooltipprotected com.vaadin.flow.component.shared.Tooltipcom.vaadin.flow.component.HasText.WhiteSpaceprotected com.vaadin.flow.component.html.DivbooleanDetermines whether the associated menu item is checkable.booleanDetermines whether the associated menu item is currently checked.booleanisEmpty()voidremove(com.vaadin.flow.component.Component... components) voidvoidSets the action to the component.voidsetCheckable(boolean checkable) Sets the checkable state of the associated menu item.voidsetChecked(boolean checked) Sets the checked state of the associated menu item.voidsetMenuItem(com.vaadin.flow.component.grid.contextmenu.GridMenuItem<T> menuItem) Sets theGridMenuItemassociated with this component.voidsetPrefixComponent(com.vaadin.flow.component.Component component) protected voidsetPrefixComponentInternal(com.vaadin.flow.component.Component prefixComponent) voidsetSuffixComponent(com.vaadin.flow.component.Component component) protected voidsetSuffixComponentInternal(com.vaadin.flow.component.Component suffixComponent) voidprotected voidsetTextComponentInternal(com.vaadin.flow.component.html.Span textComponent) com.vaadin.flow.component.shared.TooltipsetTooltipText(String text) voidsetWhiteSpace(com.vaadin.flow.component.HasText.WhiteSpace value) protected voidupdateContent(com.vaadin.flow.component.Component prefixComponent, com.vaadin.flow.component.html.Span textComponent, com.vaadin.flow.component.Component suffixComponent) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, 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
add, 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
-
ITEM_COMPONENT_CLASS_NAME
- See Also:
-
PREFIX_COMPONENT_CLASS_NAME
- See Also:
-
TEXT_COMPONENT_CLASS_NAME
- See Also:
-
SUFFIX_COMPONENT_CLASS_NAME
- See Also:
-
textComponent
protected com.vaadin.flow.component.html.Span textComponent -
prefixComponent
protected com.vaadin.flow.component.Component prefixComponent -
suffixComponent
protected com.vaadin.flow.component.Component suffixComponent -
tooltip
protected com.vaadin.flow.component.shared.Tooltip tooltip -
actionSupport
-
-
Constructor Details
-
GridMenuItemActionWrapper
public GridMenuItemActionWrapper()
-
-
Method Details
-
initContent
protected com.vaadin.flow.component.html.Div initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
-
getMenuItem
Returns the associated menu item of typeGridMenuItem.- Returns:
- the
GridMenuIteminstance associated with this component
-
getAction
-
setAction
Description copied from interface:HasActionSets the action to the component. IfoverrideComponentPropertiesistruethen the action properties will override component's properties, otherwise the component's properties will be overridden if they arenull.List of properties that the action and the component have and which can be overridden:
textdescriptionshortcutCombinationenabledvisibleiconvariant
-
addMenuItemClickListener
public com.vaadin.flow.shared.Registration addMenuItemClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.contextmenu.GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener) Adds a listener for click events on a menu item within the grid's context menu. This allows handling specific actions when a menu item is clicked.- Parameters:
clickListener- the listener to handleGridContextMenu.GridContextMenuItemClickEventevents- Returns:
- a
Registrationobject for removing the listener, if needed
-
isCheckable
public boolean isCheckable()Determines whether the associated menu item is checkable.- Returns:
- true if the menu item is checkable and not null, false otherwise
-
setCheckable
public void setCheckable(boolean checkable) Sets the checkable state of the associated menu item.- Parameters:
checkable- a boolean value indicating whether the menu item should be checkable. If true, the menu item can be checked; otherwise, it cannot be checked
-
isChecked
public boolean isChecked()Determines whether the associated menu item is currently checked.- Returns:
- true if the associated menu item is not
nulland is checked, false otherwise
-
setChecked
public void setChecked(boolean checked) Sets the checked state of the associated menu item.- Parameters:
checked- a boolean value indicating whether the menu item should be marked as checked. If true, the menu item will be checked; otherwise, it will be unchecked
-
getText
- Specified by:
getTextin interfacecom.vaadin.flow.component.HasText
-
setText
- Specified by:
setTextin interfacecom.vaadin.flow.component.HasText
-
updateContent
protected void updateContent(@Nullable com.vaadin.flow.component.Component prefixComponent, @Nullable com.vaadin.flow.component.html.Span textComponent, @Nullable com.vaadin.flow.component.Component suffixComponent) -
setPrefixComponentInternal
protected void setPrefixComponentInternal(@Nullable com.vaadin.flow.component.Component prefixComponent) -
setTextComponentInternal
protected void setTextComponentInternal(@Nullable com.vaadin.flow.component.html.Span textComponent) -
setSuffixComponentInternal
protected void setSuffixComponentInternal(@Nullable com.vaadin.flow.component.Component suffixComponent) -
getPrefixComponent
@Nullable public com.vaadin.flow.component.Component getPrefixComponent()- Specified by:
getPrefixComponentin interfacecom.vaadin.flow.component.shared.HasPrefix
-
setPrefixComponent
public void setPrefixComponent(@Nullable com.vaadin.flow.component.Component component) - Specified by:
setPrefixComponentin interfacecom.vaadin.flow.component.shared.HasPrefix
-
getSuffixComponent
@Nullable public com.vaadin.flow.component.Component getSuffixComponent()- Specified by:
getSuffixComponentin interfacecom.vaadin.flow.component.shared.HasSuffix
-
setSuffixComponent
public void setSuffixComponent(@Nullable com.vaadin.flow.component.Component component) - Specified by:
setSuffixComponentin interfacecom.vaadin.flow.component.shared.HasSuffix
-
getTooltip
public com.vaadin.flow.component.shared.Tooltip getTooltip()- Specified by:
getTooltipin interfacecom.vaadin.flow.component.shared.HasTooltip
-
getTooltipInternal
protected com.vaadin.flow.component.shared.Tooltip getTooltipInternal() -
setTooltipText
- Specified by:
setTooltipTextin interfacecom.vaadin.flow.component.shared.HasTooltip
-
getWhiteSpace
public com.vaadin.flow.component.HasText.WhiteSpace getWhiteSpace()- Specified by:
getWhiteSpacein interfacecom.vaadin.flow.component.HasText
-
setWhiteSpace
public void setWhiteSpace(com.vaadin.flow.component.HasText.WhiteSpace value) - Specified by:
setWhiteSpacein interfacecom.vaadin.flow.component.HasText
-
add
public void add(com.vaadin.flow.component.Component... components) - Specified by:
addin interfacecom.vaadin.flow.component.HasComponents
-
add
- Specified by:
addin interfacecom.vaadin.flow.component.HasComponents
-
remove
public void remove(com.vaadin.flow.component.Component... components) - Specified by:
removein interfacecom.vaadin.flow.component.HasComponents
-
removeAll
public void removeAll()- Specified by:
removeAllin interfacecom.vaadin.flow.component.HasComponents
-
addComponentAtIndex
public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component) - Specified by:
addComponentAtIndexin interfacecom.vaadin.flow.component.HasComponents
-
addComponentAsFirst
public void addComponentAsFirst(com.vaadin.flow.component.Component component) - Specified by:
addComponentAsFirstin interfacecom.vaadin.flow.component.HasComponents
-
getActionSupport
Returns theGridMenuItemActionSupportinstance associated with this wrapper.- Returns:
- the
GridMenuItemActionSupportinstance linked to the menu item.
-
createActionSupport
-
isEmpty
public boolean isEmpty()
-