Package com.iizigo.text
Class KStringInfoProviderAdapter
java.lang.Object
com.iizigo.text.KStringInfoProviderAdapter
- All Implemented Interfaces:
IKStringInfoProvider
Adapter to provide information required by KString's when converted to HTML.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionKStringInfoProviderAdapter
(String httpServer, GProp<?> anyProp, boolean shouldResolve) Constructor.Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the flag for adding the reference string in an attribute when editing the KString.double
getDPR()
Gets the device pixel ratio.Gets the HTTP Server string prefix including port.getImageTarget
(String ref) Gets the image reference.GProp
<?> Gets the property used for references look-up's.Gets the base reference name for the resource, typically an image, for the Server or the Designer.Gets the additional styles tags that need to be in the "head" of the html in order for FontFace text to provide font-face support.Gets the language code to use.boolean
installFont
(String fontFamily) Installs the font families as specified by the font family.boolean
installFonts
(List<FontFiles> fontList) Installs the font face as specified by theFontFiles
instance for the Client Session.void
Resets the font face declarations.boolean
Flag indicating the "real" resolved string should be returned.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.iizix.text.IKStringInfoProvider
installFonts
Constructor Details
KStringInfoProviderAdapter
Constructor.- Parameters:
httpServer
- The HTTP server string.anyProp
- Any property for references.shouldResolve
- Flag indicating the "real" resolved string should be returned. This value is true for the runtime client when in "real run mode".
Method Details
getHTTPServer
Gets the HTTP Server string prefix including port.- Specified by:
getHTTPServer
in interfaceIKStringInfoProvider
- Returns:
- The "HTTP[S]//server[:port]" String or null for none.
getImageTarget
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:
- true for the Designer (will add additional parameters for the rich text editor), false for normal processing.
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:
- true to resolve all references, false if inside e.g. the Designer.
getResolveReferenceProperty
Gets the property used for references look-up's.- Specified by:
getResolveReferenceProperty
in interfaceIKStringInfoProvider
- Returns:
- The property to use for reference property look-up.
getDPR
public double getDPR()Gets the device pixel ratio.- Specified by:
getDPR
in interfaceIKStringInfoProvider
- Returns:
- The device pixel ratio, default 1.0.
getTargetLanguageCode
Gets the language code to use.- Specified by:
getTargetLanguageCode
in interfaceIKStringInfoProvider
- Returns:
- The language code, or null for default.
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:
- The resource prefix string, "/$" by default, but "/$APPID/" for the Server,' where APPID is the application being run by the client.
installFont
Installs the font families as specified by the font family.- Specified by:
installFont
in interfaceIKStringInfoProvider
- Parameters:
fontFamily
- The font family or families.- Returns:
- true for success, false if the remote part doesn't support installation, e.g. in a preview browser.
installFonts
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:
- true for success, false if the remote part doesn't support installation, e.g. in a preview browser.
getStyleTagText
Gets the additional styles tags that need to be in the "head" of the html in order for FontFace text to provide font-face support.- Returns:
- The [style] tag and its declaration text containing font faces, etc, or null for none.
resetFontFace
public void resetFontFace()Resets the font face declarations.