Module MaterialFX

Class MFXNotificationCell

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

public class MFXNotificationCell extends HBox implements io.github.palexdev.virtualizedfx.cell.Cell<INotification>
Implementation of a Cell for usage with MFXNotificationCenter.

Includes a checkbox to allow selecting notifications.
  • Property Details

  • Field Details

    • SELECTED_PSEUDO_CLASS

      protected final PseudoClass SELECTED_PSEUDO_CLASS
    • container

      protected final StackPane container
    • checkbox

      protected final MFXCheckbox checkbox
  • Constructor Details

  • Method Details

    • setBehavior

      protected void setBehavior()
      Sets the following behaviors:

      - Binds the selected property to the notification center' selection model (checks for index).

      - Updates the selected PseudoClass state when selected property changes.

      - Adds a listener to the checkbox' selection state to call updateSelection(boolean).

      - Adds a listener to the notification center's MFXNotificationCenter.selectionModeProperty() to call expand(boolean).

    • render

      protected void render(INotification notification)
      Responsible for rendering the cell's content.
    • updateSelection

      protected void updateSelection(boolean checked)
      Responsible for updating the selection state according to the checkbox' state.

      If checked is true then the cell should be selected, otherwise it is deselected.

    • expand

      protected void expand(boolean selectionMode)
      Responsible for showing/hiding the checkbox.
    • getNode

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

      public void updateItem(INotification notification)
      Updates the notification property of the cell, then calls render(INotification).

      This is called after updateIndex(int).

      Specified by:
      updateItem in interface io.github.palexdev.virtualizedfx.cell.Cell<INotification>
    • updateIndex

      public void updateIndex(int index)
      Updates the index property of the cell.

      This is called before updateItem(INotification).

      Specified by:
      updateIndex in interface io.github.palexdev.virtualizedfx.cell.Cell<INotification>
    • afterLayout

      public void afterLayout()
      Ensures that the combobox container is properly expanded after the cell has been laid out.
      Specified by:
      afterLayout in interface io.github.palexdev.virtualizedfx.cell.Cell<INotification>
    • getNotification

      public INotification getNotification()
      Gets the value of the property notification.
      Property description:
      Specifies the current shown notification (in other words the cell's content).
    • notificationProperty

      public ReadOnlyObjectProperty<INotification> notificationProperty()
      Specifies the current shown notification (in other words the cell's content).
      See Also:
    • setNotification

      protected void setNotification(INotification notification)
      Sets the value of the property notification.
      Property description:
      Specifies the current shown notification (in other words the cell's content).
    • getIndex

      public int getIndex()
      Gets the value of the property index.
      Property description:
      Specifies the cell's index.
    • indexProperty

      protected ReadOnlyIntegerProperty indexProperty()
      Specifies the cell's index.
      See Also:
    • setIndex

      protected void setIndex(int index)
      Sets the value of the property index.
      Property description:
      Specifies the cell's index.
    • isSelected

      public boolean isSelected()
      Gets the value of the property selected.
      Property description:
      Specifies the selection state of the cell.
    • selectedProperty

      public ReadOnlyBooleanProperty selectedProperty()
      Specifies the selection state of the cell.
      See Also:
    • setSelected

      protected void setSelected(boolean selected)
      Sets the value of the property selected.
      Property description:
      Specifies the selection state of the cell.