java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<T,javafx.scene.control.TreeItem<T>>
org.tentackle.fx.translate.TreeItemTranslator<T>
- Type Parameters:
T- the object type
- All Implemented Interfaces:
ValueTranslator<T,javafx.scene.control.TreeItem<T>>
@ValueTranslatorService(modelClass=java.lang.Object.class,
viewClass=javafx.scene.control.TreeItem.class)
public class TreeItemTranslator<T>
extends AbstractValueTranslator<T,javafx.scene.control.TreeItem<T>>
TreeItem translator for
FxTreeView and
FxTreeTableView.- 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(T 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
-
TreeItemTranslator
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
-