Module org.tentackle.fx
Package org.tentackle.fx.translate
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 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 List<T>>
extends AbstractValueTranslator<C,javafx.collections.ObservableList<T>>
List translator.
Used for components maintaining a list of elements, such as a table.
Used for components maintaining a list of elements, such as a table.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionObservableListTranslator(FxComponent component) Creates a translator for components maintaining a list of objects. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureTableView(FxTableView<T> tableView, Class<T> elemClass) Configures the tableview.protected voidconfigureTreeTableView(FxTreeTableView<T> treeTableView, Class<T> elemClass) Configures the treetable view.protected TableConfiguration<T>createTableConfiguration(TableConfigurationProvider<T> provider) Creates the table configuration and performs the binding.Function to translate a view value to a model value.Function to translate a model value to a view value.Methods inherited from class org.tentackle.fx.translate.AbstractValueTranslator
getComponent, isLenient, isMappingIncomplete, isModelModified, saveModelValue, setLenientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.fx.ValueTranslator
bindingPropertiesUpdated, needsToModelTwice, toModel, toView
-
Constructor Details
-
ObservableListTranslator
Creates a translator for components maintaining a list of objects.- Parameters:
component- the component
-
-
Method Details
-
toViewFunction
Description copied from interface:ValueTranslatorFunction to translate a model value to a view value.- Returns:
- the function
-
toModelFunction
Description copied from interface:ValueTranslatorFunction to translate a view value to a model value.- Returns:
- the function
-
configureTableView
Configures the tableview.- Parameters:
tableView- the tableviewelemClass- the list's element class
-
configureTreeTableView
Configures the treetable view.- Parameters:
treeTableView- the treetable viewelemClass- the list's element class
-
createTableConfiguration
Creates the table configuration and performs the binding.- Parameters:
provider- the configuration provider- Returns:
- the table configuration
-