Class CollectionTreeItemTranslator<T,C extends Collection<T>>

java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<C,javafx.scene.control.TreeItem<T>>
org.tentackle.fx.translate.CollectionTreeItemTranslator<T,C>
Type Parameters:
T - the object type
C - the collection type
All Implemented Interfaces:
ValueTranslator<C,javafx.scene.control.TreeItem<T>>

@ValueTranslatorService(modelClass=java.util.Collection.class, viewClass=javafx.scene.control.TreeItem.class) public class CollectionTreeItemTranslator<T,C extends Collection<T>> extends AbstractValueTranslator<C,javafx.scene.control.TreeItem<T>>
PDO to TreeItem translator for FxTreeView and FxTreeTableView.
Used if the model provides a collection.
Author:
harald
  • Constructor Details

    • CollectionTreeItemTranslator

      public CollectionTreeItemTranslator(FxComponent component)
      Creates a translator.
      Parameters:
      component - the component
  • Method Details

    • toViewFunction

      public Function<C,javafx.scene.control.TreeItem<T>> toViewFunction()
      Description copied from interface: ValueTranslator
      Function to translate a model value to a view value.
      Returns:
      the function
    • toModelFunction

      public Function<javafx.scene.control.TreeItem<T>,C> toModelFunction()
      Description copied from interface: ValueTranslator
      Function to translate a view value to a model value.
      Returns:
      the function
    • configureComponent

      protected void configureComponent()
      Configures the component if possible.
    • getTableConfigurationProvider

      protected TableConfigurationProvider<T> getTableConfigurationProvider()
      Returns:
      null if no provider available
    • getTableConfiguration

      protected TableConfiguration<T> getTableConfiguration()
      Gets the table configuration.
      Returns:
      the config, null if not available
    • createTreeItem

      protected javafx.scene.control.TreeItem<T> createTreeItem(Object object)
      Creates a tree item.
      Uses the TableConfigurationProvider if available.
      Parameters:
      object - the object
      Returns:
      the treeitem
    • configureTreeTableView

      protected void configureTreeTableView(FxTreeTableView<T> treeTableView, TableConfiguration<T> configuration)
      Configures the treetableview.
      Parameters:
      treeTableView - the treetableview
      configuration - the table configuration, null if none