Module org.tentackle.fx
Package org.tentackle.fx.translate
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 typeC- 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
Used if the model provides a collection.
FxTreeView and FxTreeTableView.Used if the model provides a collection.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures the component if possible.protected voidconfigureTreeTableView(FxTreeTableView<T> treeTableView, TableConfiguration<T> configuration) Configures the treetableview.protected javafx.scene.control.TreeItem<T>createTreeItem(Object object) Creates a tree item.
Uses theTableConfigurationProviderif available.protected TableConfiguration<T>Gets the table configuration.protected TableConfigurationProvider<T>Gets the cachedTableConfigurationProvider.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
-
CollectionTreeItemTranslator
Creates a translator.- 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
-
configureComponent
protected void configureComponent()Configures the component if possible. -
getTableConfigurationProvider
Gets the cachedTableConfigurationProvider.- Returns:
- null if no provider available
-
getTableConfiguration
Gets the table configuration.- Returns:
- the config, null if not available
-
createTreeItem
Creates a tree item.
Uses theTableConfigurationProviderif available.- Parameters:
object- the object- Returns:
- the treeitem
-
configureTreeTableView
protected void configureTreeTableView(FxTreeTableView<T> treeTableView, TableConfiguration<T> configuration) Configures the treetableview.- Parameters:
treeTableView- the treetableviewconfiguration- the table configuration, null if none
-