Class MenuItem

java.lang.Object
org.patternfly.component.SubComponent<elemental2.dom.HTMLElement, MenuItem>
org.patternfly.component.menu.MenuItem
All Implemented Interfaces:
Attachable, ElementAttributeMethods<elemental2.dom.HTMLElement, MenuItem>, ElementClassListMethods<elemental2.dom.HTMLElement, MenuItem>, ElementConsumerMethods<elemental2.dom.HTMLElement, MenuItem>, ElementContainerMethods<elemental2.dom.HTMLElement, MenuItem>, ElementEventMethods<elemental2.dom.HTMLElement, MenuItem>, ElementIdMethods<elemental2.dom.HTMLElement, MenuItem>, ElementQueryMethods<elemental2.dom.HTMLElement>, ElementTextDelegate<elemental2.dom.HTMLElement, MenuItem>, ElementTextMethods<elemental2.dom.HTMLElement, MenuItem>, HTMLElementAttributeMethods<elemental2.dom.HTMLElement, MenuItem>, HTMLElementDataMethods<elemental2.dom.HTMLElement, MenuItem>, HTMLElementStyleMethods<elemental2.dom.HTMLElement, MenuItem>, HTMLElementVisibilityMethods<elemental2.dom.HTMLElement, MenuItem>, IsElement<elemental2.dom.HTMLElement>, TypedBuilder<elemental2.dom.HTMLElement, MenuItem>, ComponentIcon<elemental2.dom.HTMLElement, MenuItem>, ComponentIconAndText<elemental2.dom.HTMLElement, MenuItem>, ComponentContext<elemental2.dom.HTMLElement, MenuItem>, HasIdentifier<elemental2.dom.HTMLElement, MenuItem>, OuiaSupport<elemental2.dom.HTMLElement, MenuItem>, Modifiers.Disabled<elemental2.dom.HTMLElement, MenuItem>

public class MenuItem extends SubComponent<elemental2.dom.HTMLElement, MenuItem> implements Attachable, ComponentContext<elemental2.dom.HTMLElement, MenuItem>, ComponentIcon<elemental2.dom.HTMLElement, MenuItem>, ComponentIconAndText<elemental2.dom.HTMLElement, MenuItem>, Modifiers.Disabled<elemental2.dom.HTMLElement, MenuItem>, ElementTextDelegate<elemental2.dom.HTMLElement, MenuItem>, HasIdentifier<elemental2.dom.HTMLElement, MenuItem>
A menu item within a Menu component.
  • Field Details

  • Method Details

    • linkMenuItem

      public static MenuItem linkMenuItem(String identifier, String text, String href)
      Create a new menu item with type MenuItemType.link.
    • checkboxMenuItem

      public static MenuItem checkboxMenuItem(String identifier, String text)
      Create a new menu item with type MenuItemType.link.
    • asyncMenuItem

      public static MenuItem asyncMenuItem(String identifier, String text, AsyncItems<MenuList,MenuItem> loadItems)
    • skeletonMenuItem

      public static MenuItem skeletonMenuItem(String identifier, String loading)
    • attach

      public void attach(elemental2.dom.MutationRecord mutationRecord)
      Specified by:
      attach in interface Attachable
    • textDelegate

      public elemental2.dom.Element textDelegate()
      Specified by:
      textDelegate in interface ElementTextDelegate<elemental2.dom.HTMLElement, MenuItem>
    • addAction

      public MenuItem addAction(MenuItemAction itemAction)
    • add

      public MenuItem add(MenuItemAction itemAction)
    • ariaDisabled

      public MenuItem ariaDisabled()
    • ariaDisabled

      public MenuItem ariaDisabled(boolean ariaDisabled)
    • danger

      public MenuItem danger()
    • disabled

      public MenuItem disabled(boolean disabled)
      Description copied from interface: Modifiers.Disabled
      Adds/removes modifier(disabled)
      Specified by:
      disabled in interface Modifiers.Disabled<elemental2.dom.HTMLElement, MenuItem>
    • description

      public MenuItem description(String description)
    • description

      public MenuItem description(elemental2.dom.HTMLElement element)
    • external

      public MenuItem external()
    • href

      public MenuItem href(String href)
    • icon

      public MenuItem icon(elemental2.dom.Element icon)
      Specified by:
      icon in interface ComponentIcon<elemental2.dom.HTMLElement, MenuItem>
    • iconAndText

      public MenuItem iconAndText(elemental2.dom.Element icon, String text, IconPosition iconPosition)
      Specified by:
      iconAndText in interface ComponentIconAndText<elemental2.dom.HTMLElement, MenuItem>
    • removeIcon

      public MenuItem removeIcon()
      Specified by:
      removeIcon in interface ComponentIcon<elemental2.dom.HTMLElement, MenuItem>
    • selected

      public MenuItem selected()
    • store

      public <T> MenuItem store(String key, T value)
      Description copied from interface: ComponentContext
      Stores a value associated with a key.
      Specified by:
      store in interface ComponentContext<elemental2.dom.HTMLElement, MenuItem>
      Type Parameters:
      T - the type of the value being stored
      Parameters:
      key - the key associated with the value
      value - the value to be stored
    • text

      public MenuItem text(elemental2.dom.HTMLElement element)
    • that

      public MenuItem that()
      Specified by:
      that in interface TypedBuilder<elemental2.dom.HTMLElement, MenuItem>
    • onClick

      public MenuItem onClick(ComponentHandler<MenuItem> handler)
      Registers an event handler to be invoked when the menu item is clicked. If the menu item has been marked as a favorite, the handler will be called with the original menu item, not the favorite item.
      Parameters:
      handler - the event handler to associate with this menu item. This handler is invoked with the event and the current menu item instance when a click event occurs.
      Returns:
      the current MenuItem instance, allowing for method chaining.
    • identifier

      public String identifier()
      Description copied from interface: HasIdentifier
      Retrieves the identifier associated with this component.
      Specified by:
      identifier in interface HasIdentifier<elemental2.dom.HTMLElement, MenuItem>
      Returns:
      the identifier of the component
    • has

      public boolean has(String key)
      Description copied from interface: ComponentContext
      Determines whether a value is stored with the specified key.
      Specified by:
      has in interface ComponentContext<elemental2.dom.HTMLElement, MenuItem>
      Parameters:
      key - the key to check
      Returns:
      true if a value is stored with the specified key, false otherwise
    • get

      public <T> T get(String key)
      Description copied from interface: ComponentContext
      Retrieves the value associated with the given key from the ComponentContext.
      Specified by:
      get in interface ComponentContext<elemental2.dom.HTMLElement, MenuItem>
      Type Parameters:
      T - the type of the value being retrieved
      Parameters:
      key - the key associated with the value
      Returns:
      the value associated with the key, or null if no value is found