Interface MenuItem

  • All Known Subinterfaces:
    Menu

    public interface MenuItem

    MenuItem is the interface for all the objects that can live on a menu.

    • Method Detail

      • getIsContainer

        boolean getIsContainer()
        Does this item act as a container for other items?
        Returns:
        true if this MenuItem is a container for other items, false if not.
      • getIsDivider

        boolean getIsDivider()
        Is this item a divider ?
        Returns:
        true if this MenuItem is a divider, false if not.
      • getTitle

        String getTitle()
        Access the display title for the item.
        Returns:
        The display title for the item.
      • getIcon

        String getIcon()
        Access the icon name for the item (or null if no icon).
        Returns:
        The icon name for the item (or null if no icon).
      • getIsEnabled

        boolean getIsEnabled()
        Access the enabled flag for the item.
        Returns:
        True if the item is enabled, false if not.
      • getAction

        String getAction()
        Access the action string for this item; what to do when the user clicks. Note: if getIsMenu(), there will not be an action string (will return "").
        Returns:
        The action string for this item.
      • getUrl

        String getUrl()
        Access the full URL string for this item; what to do when the user clicks. Note: this if defined overrides getAction() which should be "". Note: if getIsMenu(), there will not be a URL string (will return "").
        Returns:
        The full URL string for this item.
      • getForm

        String getForm()
        Access the form name whose values will be used when this item is selected.
        Returns:
        The form name whose values will be used when this item is selected, or null if there is none.
      • getChecked

        int getChecked()
        Access the checked status of this item. Possible values are (see above) CHECKED_NA, CHECKED_FALSE, CHECKED_TRUE
        Returns:
        The the checked status of this item.
      • getItems

        List<MenuItem> getItems()
        Access the sub-items of the item. Note: if !isContainer(), there will be no sub-items (will return EmptyIterator).
        Returns:
        The sub-items of the item.
      • size

        int size()
        Count the sub-items of the item. Note: if !isContainer(), the count is 0.
        Returns:
        The count of sub-items of the item.
      • isEmpty

        boolean isEmpty()
        Check if there are any sub-items. Note: if !isContainer(), this is empty.
        Returns:
        true of there are no sub-items, false if there are.
      • getItem

        MenuItem getItem​(int index)
        Access one sub-items of the item. Note: if !isContainer(), there will be no sub-items (will return null).
        Parameters:
        index - The index position (0 based) for the sub-item to get.
        Returns:
        The sub-item of the item.
      • getIsField

        boolean getIsField()
        Access the is-field (not a button) flag.
        Returns:
        True if the item is a field, false if not.
      • getIsCurrent

        boolean getIsCurrent()
        Access the is-current flag.
        Returns:
        True if the item is the currently selected one, false if not.
      • getAccessibilityLabel

        String getAccessibilityLabel()
        Get the optional label that may be set by components to provide accessiblity information, eg alt tags, title attributes etc
        Returns:
        the value