Module MaterialFX

Class MFXListView<T>

All Implemented Interfaces:
IListView<T,MFXListCell<T>>, Styleable, EventTarget, Skinnable

public class MFXListView<T> extends AbstractMFXListView<T,MFXListCell<T>>
Implementation of a check listview based on VirtualizedFX.

Extends AbstractMFXListView.

Default cell: MFXListCell.

Default skin: MFXListViewSkin.

Holds the reference to the VirtualFlow used by the list, this allows to expose some methods from it as delegate method thus allowing to:

- Manually scroll by a certain amount of pixels

- Manually scroll to a given index (also first and last)

- Manually scroll to the given pixel value

- Set the scrollbar's speed

- Get the vertical or horizontal position of the list

- Configure extra features of the VirtualFlow, features()

- Get the currently shown cells, or a specific cell by index

It's also responsible for updating the selection model in case the items list property changes, or changes occur in the items list.
  • Property Details

  • Constructor Details

    • MFXListView

      public MFXListView()
    • MFXListView

      public MFXListView(ObservableList<T> items)
  • Method Details

    • initialize

      protected void initialize()
      Overrides:
      initialize in class AbstractMFXListView<T,MFXListCell<T>>
    • itemsChanged

      protected void itemsChanged(ListChangeListener.Change<? extends T> change)
    • getCell

      public MFXListCell<T> getCell(int index)
      Delegate method for SimpleVirtualFlow.getCell(int).
    • getCells

      public Map<Integer,MFXListCell<T>> getCells()
      Delegate method for SimpleVirtualFlow.getCells().
    • scrollBy

      public void scrollBy(double pixels)
      Delegate method for SimpleVirtualFlow.scrollBy(double).
    • scrollTo

      public void scrollTo(int index)
      Delegate method for SimpleVirtualFlow.scrollTo(int).
    • scrollToFirst

      public void scrollToFirst()
      Delegate method for SimpleVirtualFlow.scrollToFirst().
    • scrollToLast

      public void scrollToLast()
      Delegate method for SimpleVirtualFlow.scrollToLast().
    • scrollToPixel

      public void scrollToPixel(double pixel)
      Delegate method for SimpleVirtualFlow.scrollToPixel(double).
    • setHSpeed

      public void setHSpeed(double unit, double block)
      Delegate method for SimpleVirtualFlow.setHSpeed(double, double).
    • setVSpeed

      public void setVSpeed(double unit, double block)
      Delegate method for SimpleVirtualFlow.setVSpeed(double, double).
    • getVerticalPosition

      public double getVerticalPosition()
      Delegate method for SimpleVirtualFlow.getVerticalPosition().
    • getHorizontalPosition

      public double getHorizontalPosition()
      Delegate method for SimpleVirtualFlow.getHorizontalPosition().
    • features

      public io.github.palexdev.virtualizedfx.flow.simple.SimpleVirtualFlow<T,MFXListCell<T>>.io.github.palexdev.virtualizedfx.flow.simple.SimpleVirtualFlow.Features features()
      Delegate method for SimpleVirtualFlow.features().
    • setDefaultCellFactory

      protected void setDefaultCellFactory()
      Description copied from class: AbstractMFXListView
      Abstract method called automatically to set a default factory for the cells.
      Specified by:
      setDefaultCellFactory in class AbstractMFXListView<T,MFXListCell<T>>
    • getCellFactory

      public Function<T,MFXListCell<T>> getCellFactory()
      Gets the value of the property cellFactory.
      Property description:
      Returns:
      the function used to build the list cells
    • cellFactoryProperty

      public ObjectProperty<Function<T,MFXListCell<T>>> cellFactoryProperty()
      See Also:
    • setCellFactory

      public void setCellFactory(Function<T,MFXListCell<T>> cellFactory)
      Sets the value of the property cellFactory.
      Property description:
    • createDefaultSkin

      protected Skin<?> createDefaultSkin()
      Overrides:
      createDefaultSkin in class Control
    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class Region