Module MaterialFX

Class MFXDateCell

All Implemented Interfaces:
io.github.palexdev.virtualizedfx.cell.Cell<LocalDate>, Styleable, EventTarget, Skinnable

public class MFXDateCell extends Label implements io.github.palexdev.virtualizedfx.cell.Cell<LocalDate>
Simple implementation of a Cell capable of representing LocalDate values.

It has three main states:

- selected: when the cell's value is equal to MFXDatePicker.valueProperty()

- current: when the cell's value is equal to MFXDatePicker.currentDateProperty()

- extra: to mark this cells as belonging to a different month

  • Property Details

  • Field Details

    • SELECTED_PSEUDO_CLASS

      protected static final PseudoClass SELECTED_PSEUDO_CLASS
    • CURRENT_PSEUDO_CLASS

      protected static final PseudoClass CURRENT_PSEUDO_CLASS
    • EXTRA_PSEUDO_CLASS

      protected static final PseudoClass EXTRA_PSEUDO_CLASS
  • Constructor Details

  • Method Details

    • setBehavior

      protected void setBehavior()
      Sets the behavior for selected and current states. Binds the text to LocalDate.getDayOfMonth() (from the current value), binds the visible property to the cell's text (hidden if text is empty, visible if text is not empty)

      Also handles MOUSE_PRESSED events to change the date picker's value.

    • markAsExtra

      public void markAsExtra()
      Marks this cell as an extra cell.
    • unmarkAsExtra

      public void unmarkAsExtra()
      Un-marks this cell as extra.
    • getNode

      public Node getNode()
      Specified by:
      getNode in interface io.github.palexdev.virtualizedfx.cell.Cell<LocalDate>
    • updateItem

      public void updateItem(LocalDate date)
      Specified by:
      updateItem in interface io.github.palexdev.virtualizedfx.cell.Cell<LocalDate>
    • getUserAgentStylesheet

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

      public LocalDate getDate()
      Gets the value of the property date.
      Property description:
      Specifies the cell's represented date.
    • dateProperty

      public ReadOnlyObjectProperty<LocalDate> dateProperty()
      Specifies the cell's represented date.
      See Also:
    • setDate

      protected void setDate(LocalDate date)
      Sets the value of the property date.
      Property description:
      Specifies the cell's represented date.
    • isExtra

      public boolean isExtra()
      Returns:
      whether the cell is an extra cell