Class MenuDivider

  • All Implemented Interfaces:
    MenuItem

    public class MenuDivider
    extends Object
    implements MenuItem

    MenuDivider is a menu item that makes a visible divider in the menu.

    • Constructor Detail

      • MenuDivider

        public MenuDivider()
        Construct a menu divider.
    • Method Detail

      • getIsContainer

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

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

        public String getTitle()
        Access the display title for the item.
        Specified by:
        getTitle in interface MenuItem
        Returns:
        The display title for the item.
      • getIcon

        public String getIcon()
        Access the icon name for the item (or null if no icon).
        Specified by:
        getIcon in interface MenuItem
        Returns:
        The icon name for the item (or null if no icon).
      • getIsEnabled

        public boolean getIsEnabled()
        Access the enabled flag for the item.
        Specified by:
        getIsEnabled in interface MenuItem
        Returns:
        True if the item is enabled, false if not.
      • getAction

        public 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 "").
        Specified by:
        getAction in interface MenuItem
        Returns:
        The action string for this item.
      • getUrl

        public 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 "").
        Specified by:
        getUrl in interface MenuItem
        Returns:
        The full URL string for this item.
      • getForm

        public String getForm()
        Access the form name whose values will be used when this item is selected.
        Specified by:
        getForm in interface MenuItem
        Returns:
        The form name whose values will be used when this item is selected.
      • getItems

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

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

        public int getChecked()
        Access the checked status of this item. Possible values:
        Specified by:
        getChecked in interface MenuItem
        Returns:
        The the checked status of this item.
        See Also:
        MenuItem
      • size

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

        public boolean isEmpty()
        Check if there are any sub-items. Note: if !isContainer(), this is empty.
        Specified by:
        isEmpty in interface MenuItem
        Returns:
        true of there are no sub-items, false if there are.
      • getIsField

        public boolean getIsField()
        Access the is-field (not a button) flag.
        Specified by:
        getIsField in interface MenuItem
        Returns:
        True if the item is a field, false if not.