Class DropDownButton.DropDownMenuItem

All Implemented Interfaces:
Clickable<DropDownButton.DropDownMenuItem>, HandleHotKey<DropDownButton.DropDownMenuItem>
Enclosing class:
DropDownButton

Dropdown menu item.
Since:
4.0
Author:
JBStrap
  • Method Details

    • setText

      public DropDownButton.DropDownMenuItem setText(String text)
      Sets the menu item text.
      Parameters:
      text - Menu item text If null is specified, no text appears on the menu item.
      Returns:
      Menu item component
    • getText

      public String getText()
      Gets the menu item text.
      Returns:
      Menu item text or null, if no text is associated with the menu item
    • setIcon

      public DropDownButton.DropDownMenuItem setIcon(Icon icon)
      Sets the menu item icon.
      Parameters:
      icon - Menu item icon If null is specified, no icon is displayed on the menu item. Available icons are listed in the enum Icon.
      Returns:
      Menu item component
    • getIcon

      public Icon getIcon()
      Gets the menu item icon.
      Returns:
      Menu item icon or null, if no icon is associated with the menu item
    • setActive

      public DropDownButton.DropDownMenuItem setActive(boolean active)
      Sets the menu item icon.
      Parameters:
      active - If true is specified, the menu item is displayed as active If false, it is displayed as not selected.
      Returns:
      Menu item component
    • isActive

      public boolean isActive()
      Checks whether the menu item is active.
      Returns:
      If true, the menu item is active, otherwise it is not selected
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<DropDownButton.DropDownMenuItem>
      Returns:
      If the componentwas drawn, true, otherwise false