Module MaterialFX

Class MFXTableViewSkin<T>

java.lang.Object
javafx.scene.control.SkinBase<MFXTableView<T>>
io.github.palexdev.materialfx.skins.MFXTableViewSkin<T>
All Implemented Interfaces:
Skin<MFXTableView<T>>
Direct Known Subclasses:
MFXPaginatedTableViewSkin

public class MFXTableViewSkin<T> extends SkinBase<MFXTableView<T>>
This is the implementation of the Skin associated with every MFXTableView.

The top container is a VBox which contains the columns box, the virtual flow and the footer.

The MFXTableView.getTableColumns() are contained in a HBox

At the bottom of the table view there's a footer which by default has two icons to filter/clear filter. Can be changed by overriding buildFooter() or hidden(removed) by setting MFXTableView.footerVisibleProperty() to false.

The filter mechanism relies on the super flexible MFXFilterPane shown in a modal dialog.

Note: for sorting and the filtering a TransformableList is used, the original items list MFXTableView.getItems() remains untouched.

N.B: Although the layout and everything else is well organized and documented, especially with thew new implementation and considering the JavaFX's counterpart, note that this control is quite complicated and "delicate" since there is a lot going on (bindings, listeners, various computation, layout adjustments, factories, nested cells, etc...). So when extending this class or creating your table view based on this one, be careful and make sure you have fully understood how all of this works.
  • Field Details

    • container

      protected final VBox container
    • columnsContainer

      protected final HBox columnsContainer
    • rowsFlow

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

    • MFXTableViewSkin

      public MFXTableViewSkin(MFXTableView<T> tableView, io.github.palexdev.virtualizedfx.flow.simple.SimpleVirtualFlow<T,MFXTableRow<T>> rowsFlow)
  • Method Details

    • buildFooter

      protected StackPane buildFooter()
      Responsible for building the table's footer.
    • computeMaxWidth

      protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
      Overrides:
      computeMaxWidth in class SkinBase<MFXTableView<T>>
    • computeMaxHeight

      protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
      Overrides:
      computeMaxHeight in class SkinBase<MFXTableView<T>>