Package com.flowingcode.addons.applayout
Class MenuItem
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.flowingcode.addons.applayout.SlottedMenuItem
-
- com.flowingcode.addons.applayout.MenuItem
-
- 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.HasOrderedComponents,java.io.Serializable
@NpmPackage(value="@polymer/iron-collapse",version="3.0.1") @NpmPackage(value="@polymer/paper-item",version="3.0.1") @NpmPackage(value="@flowingcode/fc-menuitem",version="0.9.10") @Tag("fc-menuitem") @JsModule("@flowingcode/fc-menuitem/fc-menuitem.js") public class MenuItem extends SlottedMenuItem implements com.vaadin.flow.component.HasOrderedComponentsMenu item component.- Author:
- mlopez
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MenuItem()No argument constructorMenuItem(java.lang.String label)Create a new instance ofMenuItemwith a label.MenuItem(java.lang.String label, com.vaadin.flow.component.icon.IconFactory icon)Create a new instance ofMenuItemwith a label and anIconFactory.MenuItem(java.lang.String label, com.vaadin.flow.component.icon.IconFactory icon, com.vaadin.flow.server.Command command)Create a new instance ofMenuItemwith a label, anIconFactory, and left-button command.MenuItem(java.lang.String label, com.vaadin.flow.server.Command command)Create a new instance ofMenuItemwith a label and left-button command.MenuItem(java.lang.String label, java.lang.Class<? extends com.vaadin.flow.component.Component> navigationTarget)Create a new instance ofMenuItemwith a label for the given navigation target.MenuItem(java.lang.String label, java.lang.String icon)Create a new instance ofMenuItemwith a label and an icon.MenuItem(java.lang.String label, java.lang.String icon, com.vaadin.flow.server.Command command)Create a new instance ofMenuItemwith a label, an icon, and left-button command.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Deprecated Methods Modifier and Type Method Description MenuItemadd(MenuItem... items)Adds the given menu items as children of this component.voidadd(com.vaadin.flow.component.Component... components)MenuItemconfigure(java.util.function.Consumer<MenuItem> consumer)java.lang.StringgetHref()default java.lang.StringgetIcon()default java.lang.StringgetImage()java.lang.StringgetLabel()java.lang.StringgetTitle()default TsetCommand(MouseClickEvent.MouseButton button, com.vaadin.flow.server.Command command)default TsetCommand(com.vaadin.flow.server.Command command)MenuItemsetHref(java.lang.String href)default TsetIcon(java.lang.String icon)voidsetIconBlank()voidsetIconSpacing(boolean value)Deprecated.This method ignores the parameter.default TsetImage(java.lang.String imageUrl)MenuItemsetLabel(java.lang.String label)MenuItemsetLink(com.vaadin.flow.router.RouterLink link)MenuItemsetTitle(java.lang.String title)-
Methods inherited from class com.flowingcode.addons.applayout.SlottedMenuItem
onAttach
-
Methods 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, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
MenuItem
public MenuItem()
No argument constructor
-
MenuItem
public MenuItem(java.lang.String label)
Create a new instance ofMenuItemwith a label.
-
MenuItem
public MenuItem(java.lang.String label, com.vaadin.flow.server.Command command)Create a new instance ofMenuItemwith a label and left-button command.
-
MenuItem
public MenuItem(java.lang.String label, java.lang.Class<? extends com.vaadin.flow.component.Component> navigationTarget)Create a new instance ofMenuItemwith a label for the given navigation target.
-
MenuItem
public MenuItem(java.lang.String label, java.lang.String icon)Create a new instance ofMenuItemwith a label and an icon.
-
MenuItem
public MenuItem(java.lang.String label, com.vaadin.flow.component.icon.IconFactory icon)Create a new instance ofMenuItemwith a label and anIconFactory.
-
MenuItem
public MenuItem(java.lang.String label, com.vaadin.flow.component.icon.IconFactory icon, com.vaadin.flow.server.Command command)Create a new instance ofMenuItemwith a label, anIconFactory, and left-button command.
-
MenuItem
public MenuItem(java.lang.String label, java.lang.String icon, com.vaadin.flow.server.Command command)Create a new instance ofMenuItemwith a label, an icon, and left-button command.
-
-
Method Detail
-
add
public final MenuItem add(MenuItem... items)
Adds the given menu items as children of this component.
-
add
public void add(com.vaadin.flow.component.Component... components)
- Specified by:
addin interfacecom.vaadin.flow.component.HasComponents
-
getTitle
public java.lang.String getTitle()
-
setTitle
public MenuItem setTitle(java.lang.String title)
-
getLabel
public java.lang.String getLabel()
-
getHref
public java.lang.String getHref()
-
setLabel
public MenuItem setLabel(java.lang.String label)
-
setLink
public MenuItem setLink(com.vaadin.flow.router.RouterLink link)
-
setHref
public MenuItem setHref(java.lang.String href)
-
setIconSpacing
@Deprecated public void setIconSpacing(boolean value)
Deprecated.This method ignores the parameter. UsesetIconBlank().
-
setIconBlank
public void setIconBlank()
-
setCommand
public default T setCommand(com.vaadin.flow.server.Command command)
-
setCommand
public default T setCommand(MouseClickEvent.MouseButton button, com.vaadin.flow.server.Command command)
-
getIcon
public default java.lang.String getIcon()
-
setIcon
public default T setIcon(java.lang.String icon)
-
getImage
public default java.lang.String getImage()
-
setImage
public default T setImage(java.lang.String imageUrl)
-
-