java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<M,String>
org.tentackle.fx.translate.ValueStringTranslator<org.tentackle.common.I18NText>
org.tentackle.fx.translate.I18NTextStringTranslator
- All Implemented Interfaces:
ValueTranslator<org.tentackle.common.I18NText,String>
@ValueTranslatorService(modelClass=org.tentackle.common.I18NText.class,
viewClass=java.lang.String.class)
public class I18NTextStringTranslator
extends ValueStringTranslator<org.tentackle.common.I18NText>
I18NText translator.- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidedit()booleanReturns whether the model value is only mapped partially to the view.
Such data types may hold more data that could have changed by the translator, but the view object still looks unchanged.
An example for such a type isI18NText.booleanReturns whether the model is modified compared to value saved viaValueTranslator.saveModelValue(Object).
Only invoked ifValueTranslator.isMappingIncomplete()istrue.voidsaveModelValue(org.tentackle.common.I18NText modelValue) Remembers the model value for later check if changed.
Only invoked ifValueTranslator.isMappingIncomplete()istrue.Function to translate a view value to a model value.Function to translate a model value to a view value.voidupdateI18NText(org.tentackle.common.I18NText i18NText) Updates the model with a new I18NText object.
Invoked fromI18NEditor.Methods inherited from class org.tentackle.fx.translate.ValueStringTranslator
getComponent, getValidChars, toModelMethods inherited from class org.tentackle.fx.translate.AbstractValueTranslator
isLenient, 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, toView
-
Constructor Details
-
I18NTextStringTranslator
-
-
Method Details
-
isMappingIncomplete
public boolean isMappingIncomplete()Description copied from interface:ValueTranslatorReturns whether the model value is only mapped partially to the view.
Such data types may hold more data that could have changed by the translator, but the view object still looks unchanged.
An example for such a type isI18NText.- Specified by:
isMappingIncompletein interfaceValueTranslator<org.tentackle.common.I18NText,String> - Overrides:
isMappingIncompletein classAbstractValueTranslator<org.tentackle.common.I18NText,String> - Returns:
- true if view may look unchanged but the model could be modified
-
saveModelValue
public void saveModelValue(org.tentackle.common.I18NText modelValue) Description copied from interface:ValueTranslatorRemembers the model value for later check if changed.
Only invoked ifValueTranslator.isMappingIncomplete()istrue.- Specified by:
saveModelValuein interfaceValueTranslator<org.tentackle.common.I18NText,String> - Overrides:
saveModelValuein classAbstractValueTranslator<org.tentackle.common.I18NText,String> - Parameters:
modelValue- the model value
-
isModelModified
public boolean isModelModified()Description copied from interface:ValueTranslatorReturns whether the model is modified compared to value saved viaValueTranslator.saveModelValue(Object).
Only invoked ifValueTranslator.isMappingIncomplete()istrue.- Specified by:
isModelModifiedin interfaceValueTranslator<org.tentackle.common.I18NText,String> - Overrides:
isModelModifiedin classAbstractValueTranslator<org.tentackle.common.I18NText,String> - Returns:
- true if model is modified
-
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
-
updateI18NText
public void updateI18NText(org.tentackle.common.I18NText i18NText) Updates the model with a new I18NText object.
Invoked fromI18NEditor.- Parameters:
i18NText- the I18N text object
-
edit
protected void edit()
-