Module MaterialFX

Class MFXSimpleTreeCell<T>

Type Parameters:
T -
All Implemented Interfaces:
Styleable, EventTarget
Direct Known Subclasses:
MFXCheckTreeCell

public class MFXSimpleTreeCell<T> extends AbstractMFXTreeCell<T>
Simple implementation of a MFXTreeItem cell.

Concrete implementation of AbstractMFXTreeCell<T>.

  • Constructor Details

  • Method Details

    • defaultDisclosureNode

      protected void defaultDisclosureNode()
      Specifies how to build the default disclosure node.
      Specified by:
      defaultDisclosureNode in class AbstractMFXTreeCell<T>
    • getDisclosureNode

      public MFXIconWrapper getDisclosureNode()
      Overrides the return type of the super class according to defaultDisclosureNode()
      Specified by:
      getDisclosureNode in class AbstractMFXTreeCell<T>
      Returns:
      this cell's disclosure node instance
    • setDisclosureNode

      public <N extends Node> void setDisclosureNode(N node)
      Sets the cell's disclosure node to the specified node.
      Specified by:
      setDisclosureNode in class AbstractMFXTreeCell<T>
      Type Parameters:
      N - the specified parameter N should be a subclass of Node
    • render

      protected void render(T data)
      Specifies how the cell should represent the item's data, whether it is a node, a primitive type or something else.

      If the data is a Node then it is added to the box.

      If it is not a Node than a label is created, the label has style class: "data-label", sets its text to the calling toString on the data and then adds the label to the box.

      Specified by:
      render in class AbstractMFXTreeCell<T>
      Parameters:
      data - the item's data
    • updateCell

      public void updateCell(MFXTreeItem<T> item)
      This methods is needed for updating the cell when the item state changes. For example the disclosure node is added to all cells and should have the same size in each cell for layout reasons (think at how the HBox works and what would happen if you don't have the disclosure node) but by default it has not the icon because it is added only when the items list is not empty, when it changes from empty to full or vice versa the icon is added/removed. Updates the cell when needed. When the items list changes adds or removes the disclosure node's icon accordingly. Also checks if the item has the AbstractMFXTreeItem.startExpandedProperty() set to true, in this case the disclosure node must be rotated by 90°.
      Specified by:
      updateCell in class AbstractMFXTreeCell<T>
    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class Region