Module MaterialFX

Class MFXFilterComboBoxSkin<T>

All Implemented Interfaces:
Skin<MFXTextField>

public class MFXFilterComboBoxSkin<T> extends MFXComboBoxSkin<T>
Skin associated with every MFXFilterComboBox by default.

Extends MFXComboBoxSkin.

This skin mainly overrides the createPopupContent() and implements the method responsible for filtering the popup's listview.

  • Constructor Details

  • Method Details

    • filter

      protected void filter(String text)
      Responsible for filtering the popup's listview.

      What it really does is to use the MFXFilterComboBox.filterFunctionProperty() to produce a Predicate, which is then set on the MFXFilterComboBox.getFilterList().

      This means that since it is not bound you can even set your own predicate on that list, but everytime the text is changed in the search field it will be replaced.
    • createPopupContent

      protected Node createPopupContent()
      Responsible for creating the popup's content.

      The content is slightly different from the MFXComboBoxSkin one.

      In the previous combo box skin, a text field was positioned on top of the combo's field to input the search text.

      This time I decided to do it another way. The popup contains both the search field and the listview, contained in a VBox, this way the control is easier to maintain, and also more appealing.

      Overrides:
      createPopupContent in class MFXComboBoxSkin<T>
    • getComboBox

      public MFXFilterComboBox<T> getComboBox()
      Convenience method to cast SkinBase.getSkinnable() to MFXComboBox.

      Overridden to cast to MFXFilterComboBox.
      Overrides:
      getComboBox in class MFXComboBoxSkin<T>