# Interface SyMenuType

All Superinterfaces:
  `SyActiveReadableType, SyActiveType, SyBoundedReadableType<SySpaceParentRelativeType>, SyBoundedType<SySpaceParentRelativeType>, SyComponentReadableType, SyComponentType, SyEventReceiverType, SyKeyboardFocusableReadableType, SyKeyboardFocusableType, SyMenuReadableType, SyMouseFocusAcceptingReadableType, SyMouseFocusAcceptingType, SySizedReadableType<SySpaceParentRelativeType>, SySizedType<SySpaceParentRelativeType>, SyThemeableReadableType, SyThemeableType, SyVisibleReadableType, SyVisibleType`

public interface SyMenuType extends SyComponentType, SyMenuReadableType
A menu. A menu typically presents a vertical list of menu items, each of which can be selected by clicking. A menu is either expanded or not expanded. Only one menu can be expanded within a screen at any given time. Clicking outside of the menu typically causes the expanded menu to be no longer expanded. Menus form a tree structure, with exactly one root.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SyMenuItemAtomType`
  `addAtom(SyText text, Runnable action)`
  Add a new atom menu item
  `SyMenuItemSeparatorType`
  `addSeparator()`
  Add a new separator menu item.
  `SyMenuItemSubmenuType`
  `addSubmenu(SyText text, SyMenuType menu)`
  Add a new submenu menu item
  `com.io7m.jattribute.core.AttributeType<Boolean>`
  `expanded()`
  `List<SyMenuItemType>`
  `items()`
  `com.io7m.jorchard.core.JOTreeNodeType<SyMenuType>`
  `menuNode()`

  ### Methods inherited from interface SyActiveReadableType

  `isMouseOver`

  ### Methods inherited from interface SyActiveType

  `activity, setActive`

  ### Methods inherited from interface SyBoundedReadableType

  `boundingArea`

  ### Methods inherited from interface SyBoundedType

  `position, setPosition`

  ### Methods inherited from interface SyComponentReadableType

  `ancestorMatchingReadable, childCount, isActive, isVisible, nodeReadable, relativePositionOf, screen, viewportPositionOf, windowReadable`

  ### Methods inherited from interface SyComponentType

  `ancestorMatching, childAdd, childRemove, childrenClear, componentForWindowRelative, layout, node, window`

  ### Methods inherited from interface SyEventReceiverType

  `eventSend`

  ### Methods inherited from interface SyKeyboardFocusableType

  `keyboardFocusBehavior`

  ### Methods inherited from interface SyMenuReadableType

  `menuNodeReadable, themeClassesDefaultForComponent`

  ### Methods inherited from interface SyMouseFocusAcceptingReadableType

  `isMouseQueryAccepting`

  ### Methods inherited from interface SyMouseFocusAcceptingType

  `setMouseQueryAccepting`

  ### Methods inherited from interface SySizedType

  `setSize, setSizeUpperLimit, size, sizeUpperLimit`

  ### Methods inherited from interface SyThemeableReadableType

  `themeClassesExtra, themeClassesInPreferenceOrder`

  ### Methods inherited from interface SyVisibleType

  `setVisible, visibility`

- ## Method Details

  - ### menuNode

    com.io7m.jorchard.core.JOTreeNodeType<SyMenuType> menuNode()
    Returns:
      The node for this menu

  - ### addSeparator

    SyMenuItemSeparatorType addSeparator()
    Add a new separator menu item.
    Returns:
      The item

  - ### addAtom

    SyMenuItemAtomType addAtom(SyText text, Runnable action)
    Add a new atom menu item
    Parameters:
      `text` - The item text
      `action` - The item action
    Returns:
      The item

  - ### addSubmenu

    SyMenuItemSubmenuType addSubmenu(SyText text, SyMenuType menu)
    Add a new submenu menu item
    Parameters:
      `text` - The item text
      `menu` - The menu
    Returns:
      The item

  - ### expanded

    com.io7m.jattribute.core.AttributeType<Boolean> expanded()
    Specified by:
      `expanded` in interface `SyMenuReadableType`
    Returns:
      An attribute that indicates if this menu is currently expanded

  - ### items

    List<SyMenuItemType> items()
    Returns:
      An immutable snapshot of the items within the menu