Module org.tentackle.fx
Package org.tentackle.fx.translate
Class EnumStringTranslator<T extends Enum<T>>
java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<T,String>
org.tentackle.fx.translate.EnumStringTranslator<T>
- Type Parameters:
T- the enum type
- All Implemented Interfaces:
ValueTranslator<T,String>
@ValueTranslatorService(modelClass=java.lang.Enum.class,
viewClass=java.lang.String.class)
public class EnumStringTranslator<T extends Enum<T>>
extends AbstractValueTranslator<T,String>
Abstract base class for enum translators.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionEnumStringTranslator(FxTextComponent component, Class<T> clazz) Creates an enum translator. -
Method Summary
Modifier and TypeMethodDescriptionFunction 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
-
EnumStringTranslator
Creates an enum translator.- Parameters:
component- the text componentclazz- the enum class
-
-
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
-