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=Collection.class,
viewClass=javafx.scene.control.TreeItem.class)
public class CollectionTreeItemTranslator<T, C extends Collection<T>>
extends AbstractValueTranslator<C, javafx.scene.control.TreeItem<T>>
Collection to TreeItem translator for
Used if the model provides a collection. The elements become the children of an invisible root item. The tree items are created via the
FxTreeView and FxTreeTableView.Used if the model provides a collection. The elements become the children of an invisible root item. The tree items are created via the
TableConfiguration, if available.- 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 treetable view.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 AbstractValueTranslator
getComponent, isLenient, isMappingIncomplete, isModelModified, saveModelValue, setLenientMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 tree item
-
configureTreeTableView
protected void configureTreeTableView(FxTreeTableView<T> treeTableView, TableConfiguration<T> configuration) Configures the treetable view.- Parameters:
treeTableView- the treetable viewconfiguration- the table configuration, null if none
-