java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<String,javafx.scene.paint.Color>
org.tentackle.fx.translate.StringColorTranslator
- All Implemented Interfaces:
ValueTranslator<String,javafx.scene.paint.Color>
@ValueTranslatorService(modelClass=java.lang.String.class,
viewClass=javafx.scene.paint.Color.class)
public class StringColorTranslator
extends AbstractValueTranslator<String,javafx.scene.paint.Color>
A string/color translator.
Useful for color pickers bound to a string in the model.
Useful for color pickers bound to a string in the model.
- Author:
- harald
-
Field Summary
Fields -
Constructor Summary
Constructors -
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
-
Field Details
-
COLOR_LENGTH
public static final int COLOR_LENGTHThe fixed color string length. Ex.: "0xffffffff" for WHITE.- See Also:
-
-
Constructor Details
-
StringColorTranslator
Creates the 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
-