Class VFXSimpleCell<T>

All Implemented Interfaces:
io.github.palexdev.mfxcore.behavior.WithBehavior<CellBaseBehavior<T>>, io.github.palexdev.mfxcore.controls.MFXSkinnable<io.github.palexdev.mfxcore.controls.SkinBase<?,?>>, io.github.palexdev.mfxcore.controls.MFXStyleable, VFXCell<T>, Styleable, EventTarget, Skinnable

public class VFXSimpleCell<T> extends VFXCellBase<T>
Simple extension of VFXCellBase which by default uses the skin VFXLabeledCellSkin to display its data as text. This also expands the default style classes to be: '.cell-base' and '.cell'.

Q: Why not extend Labeled rather than Control? (Also considering that the default skin uses a Label)

A: Long story short, for flexibility. While it's true that in the vast majority of user cases, cells will just display their data as a String, it's not always the case. Extending Control does not allow users to set the label's properties (font, text color, etc.) directly (you can still do it by CSS or by using CSSFragment in code!!), but it indeed makes the architecture more flexible. See also VFXCellBase

Note: to make this even more flexible, I decided to add a StringConverter to convert an item T to the String visualized by the label. However, to make use of it, the cell extends inline the VFXLabeledCellSkin here Control.buildSkin() to override its VFXLabeledCellSkin.update() method.
  • Constructor Details

    • VFXSimpleCell

      public VFXSimpleCell(T item)
    • VFXSimpleCell

      public VFXSimpleCell(T item, StringConverter<T> converter)
  • Method Details