Class NavigationDrawer.Item

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable
    Direct Known Subclasses:
    NavigationDrawer.ViewItem
    Enclosing class:
    NavigationDrawer

    public static class NavigationDrawer.Item
    extends Control
    A convenience class for creating a default items for NavigationDrawer with styled implementations according to Material Design Guidelines. Whenever an item is clicked, the selected property of the item is automatically set to true. If the autoClose is set to true, clicking on the item will close the NavigationDrawer.
    Since:
    2.0.0
    • Constructor Detail

      • Item

        public Item​(String title)
        Allocates a new item object with title assigned from the specified String.
        Parameters:
        title - A String representing the title.
      • Item

        public Item​(String title,
                    Node graphic)
        Allocates a new item object with title and graphic.
        Parameters:
        title - A String representing the title.
        graphic - A graphic node representing icon.
    • Method Detail

      • getTitle

        public final String getTitle()
        Returns a String with the title of the Item.
        Returns:
        A String representing the title of the Item.
      • setTitle

        public final void setTitle​(String title)
        Sets the current title of the Item.
        Parameters:
        title - The current title to be set.
      • getGraphic

        public final Node getGraphic()
        Returns a node which is used as the icon of the Item.
        Returns:
        A Node containing the icon of the Item.
      • setGraphic

        public final void setGraphic​(Node graphic)
        Sets a node as an icon of the Item.
        Parameters:
        graphic - A Node to set as the icon of the Item.
      • setSelected

        public final void setSelected​(boolean value)
        Sets the value of the property selected.
        Property description:
        Indicates whether an item is selected. This can be manipulated programmatically.
      • isSelected

        public final boolean isSelected()
        Gets the value of the property selected.
        Property description:
        Indicates whether an item is selected. This can be manipulated programmatically.
      • isAutoClose

        public final boolean isAutoClose()
        Gets the value of the property autoClose.
        Property description:
        When set to false, prevents the NavigationDrawer from auto-closing when an item is pressed.
        Default value:
        true
        Since:
        5.0.0
      • setAutoClose

        public final void setAutoClose​(boolean value)
        Sets the value of the property autoClose.
        Property description:
        When set to false, prevents the NavigationDrawer from auto-closing when an item is pressed.
        Default value:
        true
        Since:
        5.0.0