Package com.iizix.text
Class ValidationKStringInfoProviderHolder
- java.lang.Object
- com.iizix.text.ValidationKStringInfoProviderHolder
- All Implemented Interfaces:
IKStringInfoProvider
,IKStringInfoProviderHolder
public class ValidationKStringInfoProviderHolder extends java.lang.Object implements IKStringInfoProvider, IKStringInfoProviderHolder
Very simple adapter to provide information required by KString's when resolving KString's for validation. Image resolving and so on is not supported. Installing fonts is not supported either.- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description ValidationKStringInfoProviderHolder(GProp<?> anyProp, java.lang.String targetLanguageCode)
Constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doAddReference()
Gets the flag for adding the reference string in an attribute when editing the KString.double
getDPR()
Gets the device pixel ratio.java.lang.String
getHTTPServer()
Gets the HTTP Server string prefix including port.IImageTarget
getImageTarget(java.lang.String ref)
Gets the image reference.IKStringInfoProvider
getKStringInfoProvider()
Retrieves the KStringInfoProvider.GProp<?>
getResolveReferenceProperty()
Gets the property used for references look-up's.java.lang.String
getResourcePrefix()
Gets the base reference name for the resource, typically an image, for the Server or the Designer.java.lang.String
getTargetLanguageCode()
Gets the language code to use.boolean
installFont(java.lang.String fontFamily)
Installs the font families as specified by the font family.boolean
installFonts(java.lang.String fontFamilies)
Installs the font families as specified by the font family.boolean
installFonts(java.util.List<FontFiles> fontList)
Installs the font face as specified by theFontFiles
instance for the Client Session.boolean
shouldResolve()
Flag indicating the "real" resolved string should be returned.
Constructor Detail
ValidationKStringInfoProviderHolder
public ValidationKStringInfoProviderHolder(GProp<?> anyProp, java.lang.String targetLanguageCode)
Constructor.- Parameters:
anyProp
- Any property for resolving references.targetLanguageCode
- Target language code when working with multiple text files.
Method Detail
getKStringInfoProvider
public IKStringInfoProvider getKStringInfoProvider()
Retrieves the KStringInfoProvider.- Specified by:
getKStringInfoProvider
in interfaceIKStringInfoProviderHolder
- Returns:
- This instance.
getHTTPServer
public java.lang.String getHTTPServer()
Gets the HTTP Server string prefix including port.- Specified by:
getHTTPServer
in interfaceIKStringInfoProvider
- Returns:
- The "http://localhost".
getImageTarget
public IImageTarget getImageTarget(java.lang.String ref)
Gets the image reference.- Specified by:
getImageTarget
in interfaceIKStringInfoProvider
- Parameters:
ref
- The image definition reference string.- Returns:
- The image found, or null if not found.
doAddReference
public boolean doAddReference()
Gets the flag for adding the reference string in an attribute when editing the KString.- Specified by:
doAddReference
in interfaceIKStringInfoProvider
- Returns:
- References in attributes should not be added, hence
false
is returned.
shouldResolve
public boolean shouldResolve()
Flag indicating the "real" resolved string should be returned. This value is true for the runtime client when in "real run mode".- Specified by:
shouldResolve
in interfaceIKStringInfoProvider
- Returns:
- Always
true
as KString's should resolve.
getResolveReferenceProperty
public GProp<?> getResolveReferenceProperty()
Gets the property used for references look-up's.- Specified by:
getResolveReferenceProperty
in interfaceIKStringInfoProvider
- Returns:
- Any property in the tree.
getDPR
public double getDPR()
Gets the device pixel ratio.- Specified by:
getDPR
in interfaceIKStringInfoProvider
- Returns:
- The device pixel ratio = 1.0d.
getTargetLanguageCode
public java.lang.String getTargetLanguageCode()
Gets the language code to use.- Specified by:
getTargetLanguageCode
in interfaceIKStringInfoProvider
- Returns:
- The language code, or null for default.
getResourcePrefix
public java.lang.String getResourcePrefix()
Gets the base reference name for the resource, typically an image, for the Server or the Designer. This reference is "/$" (the default in this interface) for the Designer, but should be "/$APPID/" for the Server, where APPID is the application being run by the client. The Server must therefore implement this method and return that string instead.- Specified by:
getResourcePrefix
in interfaceIKStringInfoProvider
- Returns:
- Always "/$".
installFont
public boolean installFont(java.lang.String fontFamily)
Installs the font families as specified by the font family.- Specified by:
installFont
in interfaceIKStringInfoProvider
- Parameters:
fontFamily
- The font family or families.- Returns:
- Always
false
as fonts are not supported.
installFonts
public boolean installFonts(java.lang.String fontFamilies)
Installs the font families as specified by the font family.- Specified by:
installFonts
in interfaceIKStringInfoProvider
- Parameters:
fontFamilies
- The font family or families, comma separated.- Returns:
- Always
false
as fonts are not supported.
installFonts
public boolean installFonts(java.util.List<FontFiles> fontList)
Installs the font face as specified by theFontFiles
instance for the Client Session. Once installed, the font family can be used.- Specified by:
installFonts
in interfaceIKStringInfoProvider
- Parameters:
fontList
- The list of font files to install.- Returns:
- Always
false
as fonts are not supported.