Class 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.HasOrderedComponents
    Menu item component.
    Author:
    mlopez
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuItem()
      No argument constructor
      MenuItem​(java.lang.String label)
      Create a new instance of MenuItem with a label.
      MenuItem​(java.lang.String label, com.vaadin.flow.component.icon.IconFactory icon)
      Create a new instance of MenuItem with a label and an IconFactory.
      MenuItem​(java.lang.String label, com.vaadin.flow.component.icon.IconFactory icon, com.vaadin.flow.server.Command command)
      Create a new instance of MenuItem with a label, an IconFactory, and left-button command.
      MenuItem​(java.lang.String label, com.vaadin.flow.server.Command command)
      Create a new instance of MenuItem with 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 of MenuItem with a label for the given navigation target.
      MenuItem​(java.lang.String label, java.lang.String icon)
      Create a new instance of MenuItem with a label and an icon.
      MenuItem​(java.lang.String label, java.lang.String icon, com.vaadin.flow.server.Command command)
      Create a new instance of MenuItem with 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
      MenuItem add​(MenuItem... items)
      Adds the given menu items as children of this component.
      void add​(com.vaadin.flow.component.Component... components)  
      MenuItem configure​(java.util.function.Consumer<MenuItem> consumer)  
      java.lang.String getHref()  
      default java.lang.String getIcon()  
      default java.lang.String getImage()  
      java.lang.String getLabel()  
      java.lang.String getTitle()  
      default T setCommand​(MouseClickEvent.MouseButton button, com.vaadin.flow.server.Command command)  
      default T setCommand​(com.vaadin.flow.server.Command command)  
      MenuItem setHref​(java.lang.String href)  
      default T setIcon​(java.lang.String icon)  
      void setIconBlank()  
      void setIconSpacing​(boolean value)
      Deprecated.
      This method ignores the parameter.
      default T setImage​(java.lang.String imageUrl)  
      MenuItem setLabel​(java.lang.String label)  
      MenuItem setLink​(com.vaadin.flow.router.RouterLink link)  
      MenuItem setTitle​(java.lang.String title)  
      • Methods inherited from class com.vaadin.flow.component.Component

        addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, 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, addComponentAsFirst, addComponentAtIndex, remove, removeAll
      • 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.HasOrderedComponents

        getChildren, getComponentAt, getComponentCount, indexOf, replace
    • Constructor Detail

      • MenuItem

        public MenuItem()
        No argument constructor
      • MenuItem

        public MenuItem​(java.lang.String label)
        Create a new instance of MenuItem with a label.
      • MenuItem

        public MenuItem​(java.lang.String label,
                        com.vaadin.flow.server.Command command)
        Create a new instance of MenuItem with 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 of MenuItem with a label for the given navigation target.
      • MenuItem

        public MenuItem​(java.lang.String label,
                        java.lang.String icon)
        Create a new instance of MenuItem with a label and an icon.
      • MenuItem

        public MenuItem​(java.lang.String label,
                        com.vaadin.flow.component.icon.IconFactory icon)
        Create a new instance of MenuItem with a label and an IconFactory.
      • MenuItem

        public MenuItem​(java.lang.String label,
                        com.vaadin.flow.component.icon.IconFactory icon,
                        com.vaadin.flow.server.Command command)
        Create a new instance of MenuItem with a label, an IconFactory, 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 of MenuItem with 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:
        add in interface com.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)
      • configure

        public MenuItem configure​(java.util.function.Consumer<MenuItem> consumer)
      • setIconSpacing

        @Deprecated
        public void setIconSpacing​(boolean value)
        Deprecated.
        This method ignores the parameter. Use setIconBlank().
      • setIconBlank

        public void setIconBlank()
      • setCommand

        public default T setCommand​(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)