Class Chip

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    @DefaultProperty("text")
    public class Chip
    extends Control

    Chips represent complex entities in small blocks, such as a contact. They can contain a photo, short title string, and brief information. They can also either be deletable, i.e. present a delete button, or not.

    Screenshot of Chips
    Since:
    2.0.0
    • Constructor Detail

      • Chip

        public Chip()
        Creates a non deletable Chip with an empty string for its label.
      • Chip

        public Chip​(String text)
        Creates a non deletable Chip with the specified label.
        Parameters:
        text - The label string of the control.
      • Chip

        public Chip​(String text,
                    boolean isDeletable)
    • Method Detail

      • setDeletable

        public final void setDeletable​(boolean value)
        Sets the value of the property deletable.
        Property description:
        Indicates whether this Chip is deletable.
      • isDeletable

        public final boolean isDeletable()
        Gets the value of the property deletable.
        Property description:
        Indicates whether this Chip is deletable.
      • setText

        public final void setText​(String value)
        Sets the value of the property text.
        Property description:
        The text to display in the Chip.
      • getText

        public final String getText()
        Gets the value of the property text.
        Property description:
        The text to display in the Chip.
      • setOnDeleteAction

        public final void setOnDeleteAction​(EventHandler<ActionEvent> onClose)
        Sets the value of the property onDeleteAction.
        Property description:
        The action that is to be invoked when the user presses the delete button
      • getOnDeleteAction

        public final EventHandler<ActionEvent> getOnDeleteAction()
        Gets the value of the property onDeleteAction.
        Property description:
        The action that is to be invoked when the user presses the delete button
      • setGraphic

        public final void setGraphic​(Image value)
        Sets the value of the property graphic.
        Property description:
        An optional graphic for the Chip
      • getGraphic

        public final Image getGraphic()
        Gets the value of the property graphic.
        Property description:
        An optional graphic for the Chip
      • getClassCssMetaData

        public static List<CssMetaData<? extends Styleable,​?>> getClassCssMetaData()
        Returns:
        The CssMetaData associated with this class, which may include the CssMetaData of its super classes.
        Since:
        JavaFX 8.0