Module org.tentackle.fx
Package org.tentackle.fx.translate
Class ObservableListTranslator<T,C extends java.util.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 typeC- 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 Summary
Constructors Constructor Description ObservableListTranslator(FxComponent component)Creates a translator for components maintaining a list of objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureTableView(FxTableView<T> tableView, java.lang.Class<T> elemClass)Configures the tableview.java.util.function.Function<javafx.collections.ObservableList<T>,C>toModelFunction()Function to translate a view value to a model value.java.util.function.Function<C,javafx.collections.ObservableList<T>>toViewFunction()Function to translate a model value to a view value.-
Methods inherited from class org.tentackle.fx.translate.AbstractValueTranslator
getComponent, isLenient, setLenient
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tentackle.fx.ValueTranslator
bindingPropertiesUpdated, needsToModelTwice, toModel, toView
-
-
-
-
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:ValueTranslatorFunction 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:ValueTranslatorFunction 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 tableviewelemClass- the list's elememt class
-
-