Module MaterialFX

Class MFXTableView<T>

Type Parameters:
T - The type of the data within the table.
All Implemented Interfaces:
Styleable, EventTarget, Skinnable
Direct Known Subclasses:
MFXPaginatedTableView

public class MFXTableView<T> extends Control
This is the implementation of a table view following Google's material design guidelines in JavaFX.

Extends Control and provides a new skin since it is built from scratch.

See Also:
  • Property Details

  • Field Details

    • rowsFlow

      protected final io.github.palexdev.virtualizedfx.flow.simple.SimpleVirtualFlow<T,MFXTableRow<T>> rowsFlow
    • virtualFlowInitialized

      protected final ReadOnlyBooleanWrapper virtualFlowInitialized
  • Constructor Details

    • MFXTableView

      public MFXTableView()
    • MFXTableView

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

    • itemsChanged

      protected void itemsChanged(ListChangeListener.Change<? extends T> change)
      Responsible for updating the selection when the items list changes.
    • update

      public void update()
      Allows to programmatically update the table.

      Uses MFXTableRow.updateRow() on the currently built rows, SimpleVirtualFlow.getCells().

    • autosizeColumns

      public void autosizeColumns()
      Autosize all the table columns.
    • autosizeColumn

      public void autosizeColumn(int index)
      Autosizes the column at the given index.

      This method fails silently if it can not get the column at index.

    • autosizeColumn

      public void autosizeColumn(MFXTableColumn<T> column)
      Autosizes the given column.
    • autosizeColumnsOnInitialization

      public void autosizeColumnsOnInitialization()
      This should be called only if you need to autosize the columns before the table is laid out/initialized.

      Calling this afterwards won't have any effect.

    • getCell

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

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

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

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

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

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

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

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

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

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

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

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class Region
    • layoutChildren

      protected void layoutChildren()
      Overrides:
      layoutChildren in class Control
    • getItems

      public ObservableList<T> getItems()
      Gets the value of the property items.
      Property description:
      Specifies the table's ObservableList containing the items.
    • itemsProperty

      public ObjectProperty<ObservableList<T>> itemsProperty()
      Specifies the table's ObservableList containing the items.
      See Also:
    • setItems

      public void setItems(ObservableList<T> items)
      Sets the value of the property items.
      Property description:
      Specifies the table's ObservableList containing the items.
    • getSelectionModel

      public IMultipleSelectionModel<T> getSelectionModel()
      Returns:
      the selection model used by the table to handle row selection
    • getTableColumns

      public ObservableList<MFXTableColumn<T>> getTableColumns()
      Returns:
      the list containing the table's columns
    • getTableRowFactory

      public Function<T,MFXTableRow<T>> getTableRowFactory()
      Gets the value of the property tableRowFactory.
      Property description:
      Specifies the Function used to generate the table rows.
    • tableRowFactoryProperty

      public FunctionProperty<T,MFXTableRow<T>> tableRowFactoryProperty()
      Specifies the Function used to generate the table rows.
      See Also:
    • setTableRowFactory

      public void setTableRowFactory(Function<T,MFXTableRow<T>> tableRowFactory)
      Sets the value of the property tableRowFactory.
      Property description:
      Specifies the Function used to generate the table rows.
    • getTransformableList

      public TransformableListWrapper<T> getTransformableList()
      Returns:
      the list that is effectively used by the SimpleVirtualFlow (which contains the table rows). This list is capable of filtering and sorting.
      See Also:
    • getFilters

      public ObservableList<AbstractFilter<T,?>> getFilters()
      Returns:
      the list containing the filters' information used by the MFXFilterPane to filter the table
    • isFooterVisible

      public boolean isFooterVisible()
      Gets the value of the property footerVisible.
      Property description:
      Specifies whether the table's footer is visible
    • footerVisibleProperty

      public BooleanProperty footerVisibleProperty()
      Specifies whether the table's footer is visible
      See Also:
    • setFooterVisible

      public void setFooterVisible(boolean footerVisible)
      Sets the value of the property footerVisible.
      Property description:
      Specifies whether the table's footer is visible
    • isVirtualFlowInitialized

      public boolean isVirtualFlowInitialized()
      Gets the value of the property virtualFlowInitialized.
      Property description:
      Useful property to inform that the table layout has been initialized/is ready.

      For example it is used by autosizeColumnsOnInitialization() to autosize the columns before the table is even laid out by using a listener.

      It is considered initialized as soon as the SimpleVirtualFlow retrieves the cells' height.

    • virtualFlowInitializedProperty

      public ReadOnlyBooleanProperty virtualFlowInitializedProperty()
      Useful property to inform that the table layout has been initialized/is ready.

      For example it is used by autosizeColumnsOnInitialization() to autosize the columns before the table is even laid out by using a listener.

      It is considered initialized as soon as the SimpleVirtualFlow retrieves the cells' height.

      See Also: