Package icyllis.modernui.view

# Interface SubMenu

All Superinterfaces:
  `Menu`

All Known Implementing Classes:
  `SubMenuBuilder`

public interface SubMenu extends Menu
Subclass of `Menu` for sub menus.

Sub menus do not support item icons, or nested sub menus.

### Developer Guides

For information about creating menus, read the Menus developer guide.

- ## Field Summary

  ### Fields inherited from interface icyllis.modernui.view.Menu

  `CATEGORY_ALTERNATIVE, CATEGORY_CONTAINER, CATEGORY_MASK, CATEGORY_SECONDARY, CATEGORY_SHIFT, CATEGORY_SYSTEM, FIRST, FLAG_ALWAYS_PERFORM_CLOSE, FLAG_PERFORM_NO_CLOSE, NONE, SUPPORTED_MODIFIERS_MASK, USER_MASK, USER_SHIFT`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearHeader()`
  Clears the header of the submenu.
  `MenuItem`
  `getItem()`
  Gets the `MenuItem` that represents this submenu in the parent menu.
  `SubMenu`
  `setHeaderIcon(Drawable icon)`
  Sets the submenu header's icon to the icon given in icon `Drawable`.
  `SubMenu`
  `setHeaderTitle(CharSequence title)`
  Sets the submenu header's title to the title given in title.
  `SubMenu`
  `setHeaderView(View view)`
  Sets the header of the submenu to the `View` given in view.
  `SubMenu`
  `setIcon(Drawable icon)`
  Change the icon associated with this submenu's item in its parent menu.

  ### Methods inherited from interface icyllis.modernui.view.Menu

  `add, add, addSubMenu, addSubMenu, clear, close, findItem, getItem, hasVisibleItems, isShortcutKey, performIdentifierAction, performShortcut, removeGroup, removeItem, setGroupCheckable, setGroupDividerEnabled, setGroupEnabled, setGroupVisible, setQwertyMode, size`

- ## Method Details

  - ### setHeaderTitle

    @NonNull SubMenu setHeaderTitle(CharSequence title)
    Sets the submenu header's title to the title given in title.
    Parameters:
      `title` - The character sequence used for the title.
    Returns:
      This SubMenu so additional setters can be called.

  - ### setHeaderIcon

    @NonNull SubMenu setHeaderIcon(Drawable icon)
    Sets the submenu header's icon to the icon given in icon `Drawable`.
    Parameters:
      `icon` - The `Drawable` used for the icon.
    Returns:
      This SubMenu so additional setters can be called.

  - ### setHeaderView

    @NonNull SubMenu setHeaderView(View view)
    Sets the header of the submenu to the `View` given in view. This replaces the header title and icon (and those replace this).
    Parameters:
      `view` - The `View` used for the header.
    Returns:
      This SubMenu so additional setters can be called.

  - ### clearHeader

    void clearHeader()
    Clears the header of the submenu.

  - ### setIcon

    @NonNull SubMenu setIcon(Drawable icon)
    Change the icon associated with this submenu's item in its parent menu.
    Parameters:
      `icon` - The new icon (as a Drawable) to be displayed.
    Returns:
      This SubMenu so additional setters can be called.
    See Also:
      - `MenuItem.setIcon(Drawable)`

  - ### getItem

    @NonNull MenuItem getItem()
    Gets the `MenuItem` that represents this submenu in the parent menu. Use this for setting additional item attributes.
    Returns:
      The `MenuItem` that launches the submenu when invoked.