Package com.storedobject.vaadin
Class MenuItem
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.Div
com.storedobject.vaadin.MenuItem
- All Implemented Interfaces:
ApplicationMenuItem,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.html.Div>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasOrderedComponents,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasText,Serializable
@CssImport("./so/menu/styles.css")
public class MenuItem
extends com.vaadin.flow.component.html.Div
implements ApplicationMenuItem
Default implementation of
ApplicationMenuItem and ApplicationMenuItemGroup.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
com.vaadin.flow.component.HasText.WhiteSpace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ApplicationMenuItemcreate(ExecutableView view, String menuLabel, Runnable menuAction) Create a menu item for aView.static ApplicationMenuItemCreate a menu item.static ApplicationMenuItemGroupcreateGroup(String menuLabel) Create a group menu item.voiddehilite()De-highlight the menu item so that it looks normal.voidhilite()Highlight the menu item so that it looks stand out among other menu items.booleanIs this menu item enabled?voidsetEnabled(boolean enabled) Enable or disable this menu item.voidSet the caption for the menu item.Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, 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.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replaceMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
MenuItem
-
-
Method Details
-
create
Create a menu item.- Parameters:
menuLabel- Label.icon- Icon.menuAction- Action.- Returns:
- Menu item.
-
create
public static ApplicationMenuItem create(ExecutableView view, String menuLabel, Runnable menuAction) Create a menu item for aView.- Parameters:
view- View.menuLabel- Label.menuAction- Action.- Returns:
- Menu item.
-
createGroup
Create a group menu item.- Parameters:
menuLabel- Label.- Returns:
- Group menu item.
-
hilite
public void hilite()Description copied from interface:ApplicationMenuItemHighlight the menu item so that it looks stand out among other menu items.- Specified by:
hilitein interfaceApplicationMenuItem
-
dehilite
public void dehilite()Description copied from interface:ApplicationMenuItemDe-highlight the menu item so that it looks normal.- Specified by:
dehilitein interfaceApplicationMenuItem
-
setLabel
Description copied from interface:ApplicationMenuItemSet the caption for the menu item.- Specified by:
setLabelin interfaceApplicationMenuItem- Parameters:
caption- Caption
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:ApplicationMenuItemEnable or disable this menu item. (A disabled item should not be clickable).- Specified by:
setEnabledin interfaceApplicationMenuItem- Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled- Parameters:
enabled- Whether to enable or not.
-
isEnabled
public boolean isEnabled()Description copied from interface:ApplicationMenuItemIs this menu item enabled?- Specified by:
isEnabledin interfaceApplicationMenuItem- Specified by:
isEnabledin interfacecom.vaadin.flow.component.HasEnabled- Returns:
- True/false.
-