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, com.vaadin.flow.component.HasStyle, 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="1.0.0") @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:
  • Constructor Summary

    Constructors
    Constructor
    Description
    No argument constructor
    Create a new instance of MenuItem with a label.
    MenuItem(String label, com.vaadin.flow.component.icon.IconFactory icon)
    Create a new instance of MenuItem with a label and an IconFactory.
    MenuItem(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(String label, com.vaadin.flow.server.Command command)
    Create a new instance of MenuItem with a label and left-button command.
    MenuItem(String label, Class<? extends com.vaadin.flow.component.Component> navigationTarget)
    Create a new instance of MenuItem with a label for the given navigation target.
    MenuItem(String label, String icon)
    Create a new instance of MenuItem with a label and an icon.
    MenuItem(String label, 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

    Modifier and Type
    Method
    Description
    final MenuItem
    add(MenuItem... items)
    Adds the given menu items as children of this component.
    void
    add(com.vaadin.flow.component.Component... components)
     
     
     
    default String
     
    default String
     
     
     
    default MenuItem
    setCommand(MouseClickEvent.MouseButton button, com.vaadin.flow.server.Command command)
     
    default MenuItem
    setCommand(com.vaadin.flow.server.Command command)
     
     
    default MenuItem
     
    void
     
    void
    setIconSpacing(boolean value)
    Deprecated.
    This method ignores the parameter.
    default MenuItem
    setImage(String imageUrl)
     
     
    setLink(com.vaadin.flow.router.RouterLink link)
     
    setOpened(boolean opened)
     
     

    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, removeFromParent, scrollIntoView, scrollIntoView, 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, add, addComponentAsFirst, addComponentAtIndex, remove, 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

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Constructor Details

    • MenuItem

      public MenuItem()
      No argument constructor
    • MenuItem

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

      public MenuItem(String label, com.vaadin.flow.server.Command command)
      Create a new instance of MenuItem with a label and left-button command.
    • MenuItem

      public MenuItem(String label, 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(String label, String icon)
      Create a new instance of MenuItem with a label and an icon.
    • MenuItem

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

      public MenuItem(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(String label, String icon, com.vaadin.flow.server.Command command)
      Create a new instance of MenuItem with a label, an icon, and left-button command.
  • Method Details

    • 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 String getTitle()
    • setTitle

      public MenuItem setTitle(String title)
    • getLabel

      public String getLabel()
    • getHref

      public String getHref()
    • setLabel

      public MenuItem setLabel(String label)
    • setLink

      public MenuItem setLink(com.vaadin.flow.router.RouterLink link)
    • setHref

      public MenuItem setHref(String href)
    • setOpened

      public MenuItem setOpened(boolean opened)
    • configure

      public MenuItem configure(Consumer<MenuItem> consumer)
    • setIconSpacing

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

      public void setIconBlank()
    • setCommand

      default MenuItem setCommand(com.vaadin.flow.server.Command command)
    • setCommand

      default MenuItem setCommand(MouseClickEvent.MouseButton button, com.vaadin.flow.server.Command command)
    • getIcon

      default String getIcon()
    • setIcon

      default MenuItem setIcon(String icon)
    • getImage

      default String getImage()
    • setImage

      default MenuItem setImage(String imageUrl)