Class AbstractMenuItem

  • All Implemented Interfaces:
    java.lang.Comparable<MenuItem>, MenuItem
    Direct Known Subclasses:
    NavigationMenuItem, SimpleMenuItem

    public abstract class AbstractMenuItem
    extends java.lang.Object
    implements MenuItem
    Convenient object which provides setter/getter for label, order and checkable. May be enough for custom MenuItem implementations.
    Author:
    mvrueden
    • Constructor Detail

      • AbstractMenuItem

        public AbstractMenuItem()
    • Method Detail

      • getLabel

        public java.lang.String getLabel()
        Description copied from interface: MenuItem
        The Label of the menu item.
        Specified by:
        getLabel in interface MenuItem
        Returns:
        The label of the menu item.
      • setLabel

        public void setLabel​(java.lang.String label)
      • getChildren

        public java.util.List<MenuItem> getChildren()
        Description copied from interface: MenuItem
        The MenuItems can be cascaded (allowing a tree).
        Specified by:
        getChildren in interface MenuItem
        Returns:
        the children, or an empty list if no children exits. Must not be null.
      • addChildren

        public void addChildren​(MenuItem menuItem)
        Description copied from interface: MenuItem
        Adds a children to the current MenuItem
        Specified by:
        addChildren in interface MenuItem
        Parameters:
        menuItem - the child to add.
      • setOrder

        public void setOrder​(int order)
        Specified by:
        setOrder in interface MenuItem
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface MenuItem
      • isCheckable

        public boolean isCheckable()
        Description copied from interface: MenuItem
        Defines if the current MenuItem is a checkable item.
        Specified by:
        isCheckable in interface MenuItem
        Returns:
        true if checkable, false otherwise
        See Also:
        MenuBar.MenuItem.isCheckable()
      • setCheckable

        public void setCheckable​(boolean checkable)