Class ObservableListTranslator<T,C extends List<T>>

java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<C,javafx.collections.ObservableList<T>>
org.tentackle.fx.translate.ObservableListTranslator<T,C>
Type Parameters:
T - the element type
C - the collection type
All Implemented Interfaces:
ValueTranslator<C,javafx.collections.ObservableList<T>>

@ValueTranslatorService(modelClass=java.util.List.class, viewClass=javafx.collections.ObservableList.class) public class ObservableListTranslator<T,C extends List<T>> extends AbstractValueTranslator<C,javafx.collections.ObservableList<T>>
List translator.
Used for components maintaining a list of elements, such as a table.
Author:
harald
  • Constructor Details

    • ObservableListTranslator

      public ObservableListTranslator(FxComponent component)
      Creates a translator for components maintaining a list of objects.
      Parameters:
      component - the component
  • Method Details

    • toViewFunction

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

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

      protected void configureTableView(FxTableView<T> tableView, Class<T> elemClass)
      Configures the tableview.
      Parameters:
      tableView - the tableview
      elemClass - the list's element class
    • configureTreeTableView

      protected void configureTreeTableView(FxTreeTableView<T> treeTableView, Class<T> elemClass)
      Configures the treetable view.
      Parameters:
      treeTableView - the treetable view
      elemClass - the list's element class
    • createTableConfiguration

      protected TableConfiguration<T> createTableConfiguration(TableConfigurationProvider<T> provider)
      Creates the table configuration and performs the binding.
      Parameters:
      provider - the configuration provider
      Returns:
      the table configuration