Module MaterialFX

Class MFXTableRowCell<T,E>

All Implemented Interfaces:
Styleable, EventTarget, Skinnable

public class MFXTableRowCell<T,E> extends Labeled
This is the implementation of the row cells used by MFXTableView to fill a MFXTableRow.

The cell is built by the corresponding column that defines the factory, MFXTableColumn.rowCellFactoryProperty().

To make it easily customizable, extends Labeled and provides a new default skin, MFXTableRowCellSkin.

The default skin, MFXTableRowCellSkin, also allows placing up to two nodes in the cell. These nodes are specified by the following properties, leadingGraphicProperty(), trailingGraphicProperty().

A little side note, also to respond to some GitHub issues. It is not recommended to use big nodes. It is not recommended to use too many nodes, that's why it's limited to two. If you need a lot of controls then consider having specific columns which build cells only with graphic like here Example.

Since it now extends Labeled you can easily define your own skin and do whatever you like with the control, just keep in mind that tables are designed to mostly show text.

The new implementation doesn't bind the text anymore, but requires the user to specify the Function to extract from an object of type T (which is the same type of the table view) the data E the cell will represent. This way the cell's content is not updated anymore via observables/bindings, but it's managed by the parent MFXTableRow, or updated programmatically when requested by the table view (but the update process always starts from the row though). The cell's text is computed using a StringConverter, the default converter uses Objects.toString(Object) The update process is handled by update(Object).

  • Property Details

  • Constructor Details

  • Method Details

    • update

      public void update(T item)
      Responsible for updating the cell's text.
    • computePrefWidth

      public double computePrefWidth(double height)

      Overridden to make it public.

      Needed by the table view to compute the cell's width at which the content is not truncated. The width computation is handled by the skin's computePrefWidth(...) method.

      Overrides:
      computePrefWidth in class Control
    • createDefaultSkin

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

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

      public Node getLeadingGraphic()
      Gets the value of the property leadingGraphic.
      Property description:
      Specifies the cell's leading node
    • leadingGraphicProperty

      public ObjectProperty<Node> leadingGraphicProperty()
      Specifies the cell's leading node
      See Also:
    • setLeadingGraphic

      public void setLeadingGraphic(Node leadingGraphic)
      Sets the value of the property leadingGraphic.
      Property description:
      Specifies the cell's leading node
    • getTrailingGraphic

      public Node getTrailingGraphic()
      Gets the value of the property trailingGraphic.
      Property description:
      Specifies the cell's trailing node
    • trailingGraphicProperty

      public ObjectProperty<Node> trailingGraphicProperty()
      Specifies the cell's trailing node
      See Also:
    • setTrailingGraphic

      public void setTrailingGraphic(Node trailingGraphic)
      Sets the value of the property trailingGraphic.
      Property description:
      Specifies the cell's trailing node