Module MaterialFX

Class MFXComboBoxSkin<T>

All Implemented Interfaces:
Skin<MFXTextField>
Direct Known Subclasses:
MFXFilterComboBoxSkin

public class MFXComboBoxSkin<T> extends MFXTextFieldSkin
Skin associated with every MFXComboBox by default.

Extends MFXTextFieldSkin since most features are inherited from MFXTextField and adds the necessary properties/behaviors to add the popup listview.

The listview used in the popup is not really a listview, but I decided to directly use a SimpleVirtualFlow to make things easier, so that I don't have to worry about synchronization between the combobox' selection model and the listview' selection model
  • Field Details

    • virtualFlow

      protected io.github.palexdev.virtualizedfx.flow.simple.SimpleVirtualFlow<T,io.github.palexdev.virtualizedfx.cell.Cell<T>> virtualFlow
  • Constructor Details

  • Method Details

    • setBehavior

      protected void setBehavior()
    • updateValue

      protected void updateValue(T item)
      Responsible for updating the combo's text with the given item.

      The item is converted using the combo's MFXComboBox.converterProperty(). In case it's null uses toString().

      The caret is always positioned at the end of the text after the update.

    • animateIcon

      protected void animateIcon(Node icon, boolean showing)
      Animates the trailing icon using the MFXComboBox.animationProviderProperty().
    • createPopup

      protected MFXPopup createPopup()
      Responsible for creating the combo box's popup.
    • createPopupContent

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

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

      public void dispose()
      Specified by:
      dispose in interface Skin<T>
      Overrides:
      dispose in class SkinBase<MFXTextField>