Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc.translate
Class PdoStringTranslator<T extends org.tentackle.pdo.PersistentDomainObject<T>>
- java.lang.Object
-
- org.tentackle.fx.translate.AbstractValueTranslator<M,java.lang.String>
-
- org.tentackle.fx.translate.ValueStringTranslator<T>
-
- org.tentackle.fx.rdc.translate.PdoStringTranslator<T>
-
- Type Parameters:
T- the PDO type
- All Implemented Interfaces:
org.tentackle.fx.ValueTranslator<T,java.lang.String>
@ValueTranslatorService(modelClass=org.tentackle.pdo.PersistentDomainObject.class, viewClass=java.lang.String.class) public class PdoStringTranslator<T extends org.tentackle.pdo.PersistentDomainObject<T>> extends org.tentackle.fx.translate.ValueStringTranslator<T>PDO to String translator. TODO: DnD support- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description PdoStringTranslator(org.tentackle.fx.FxTextComponent component)Creates a translator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PdoComponentAddon<T>createPdoAddon()Creates the PDO style implementation.protected org.tentackle.bind.BindablegetBindableAnnotation(T proxy)Gets theBindableannotation of the unique domain key.protected TgetPdo()Gets the PDO via binding.
For non-editable comboboxes this translator isnt used, but registered, because it could be changed to editable.PdoComponentAddon<T>getPdoAddon()Gets the PDO addon.protected voidpresetSearchCriteria(T proxy, java.lang.Class<?> udkClass, java.lang.String v)Preset the given proxy with the string from the component.voidsetPdoAddon(PdoComponentAddon<T> pdoAddon)Sets the PDO addon.java.util.function.Function<java.lang.String,T>toModelFunction()java.util.function.Function<T,java.lang.String>toViewFunction()-
Methods inherited from class org.tentackle.fx.translate.ValueStringTranslator
getComponent, getValidChars, toModel
-
Methods inherited from class org.tentackle.fx.translate.AbstractValueTranslator
isLenient, setLenient
-
-
-
-
Method Detail
-
getPdoAddon
public PdoComponentAddon<T> getPdoAddon()
Gets the PDO addon.- Returns:
- the addon
-
setPdoAddon
public void setPdoAddon(PdoComponentAddon<T> pdoAddon)
Sets the PDO addon.- Parameters:
pdoAddon- the addon
-
toViewFunction
public java.util.function.Function<T,java.lang.String> toViewFunction()
-
toModelFunction
public java.util.function.Function<java.lang.String,T> toModelFunction()
-
createPdoAddon
protected PdoComponentAddon<T> createPdoAddon()
Creates the PDO style implementation.- Returns:
- the implementation
-
getPdo
protected T getPdo()
Gets the PDO via binding.
For non-editable comboboxes this translator isnt used, but registered, because it could be changed to editable.- Returns:
- the model value
-
presetSearchCriteria
protected void presetSearchCriteria(T proxy, java.lang.Class<?> udkClass, java.lang.String v)
Preset the given proxy with the string from the component.- Parameters:
proxy- the proxy pdoudkClass- the class of the unique domain keyv- the view value
-
getBindableAnnotation
protected org.tentackle.bind.Bindable getBindableAnnotation(T proxy)
Gets theBindableannotation of the unique domain key.If the UDK consists of more than one member, the first Bindable annotation is returned.
- Parameters:
proxy- the PDO class to inspect- Returns:
- the annotation, null if not annotated with Bindable
-
-