Class ObservableListTranslator<T,​C extends java.util.List<T>>

  • 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 java.util.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 Detail

      • ObservableListTranslator

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

      • toViewFunction

        public java.util.function.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 java.util.function.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,
                                          java.lang.Class<T> elemClass)
        Configures the tableview.
        Parameters:
        tableView - the tableview
        elemClass - the list's elememt class