Package com.iizix.prop
Class TextTable
- All Implemented Interfaces:
EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,IReferenceOwner<TextTable>
,IReferencingPropCnr
,ITextTableReferenceOwner
,Cloneable
- Direct Known Subclasses:
EditorTextTable
The text table property holds the text table items consisting of KStrings. A text table
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant for the atom name of the property: automatic translation from this table.static final String
Constant for the atom name of the property: automatic translation to this table.static final TextTable[]
An empty array.static final String
Constant for the atom name of the property: must defined every derived entry.static final String
Constant for the atom name of the property: enable verification of entries.Fields inherited from class com.iizix.prop.PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID, nameTable
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone must be overridden.Gets all tables in all open projects that derives from this text table and also the ones deriving from a derived text table recursively.String[]
Gets all the language codes supported by this text table and the derived text tables recursively.Gets the language map recursively.getDerivedTextTable
(String languageCode) Gets the derived text table to this text table with the specified language code.getDerivedTextTableRecursive
(String languageCode) Gets the derived text table to this text table with the specified language code recursively, searching the chain of derived table, derived-derived tables, and so on.Gets all tables in all open projects that derives from this text table.Gets the text table that is derived.Gets the text table reference string that this tables derives.Gets the description of this text table.getKStringProp
(String id) Gets the text entry in this table.getKStringProp
(String id, String languageCode) Gets the text entry with the specified ID for a language.Gets the language for this text table.Gets the language description for the language of this text table.getPlainTextID
(String id, IKStringInfoProvider infoProvider) Gets the text entry in this table.getPlainTextID
(String id, String fallback, IKStringInfoProvider infoProvider) Gets the text entry in this table.getPlainTextID
(String id, String languageCode, String fallback, IKStringInfoProvider infoProvider) Gets the text entry with the specified ID for a language.Gets the reference Type.Gets the single potential instance of a referencing property instance.Gets the array of referencing property instances.Get the text associated with the specified text name or text ID.Gets the text entry in this table.Gets the text entry in this table.Gets the text entry with the specified ID for a language.Gets the text entry with the specified ID for a language.getTextProp
(Atom atom) Get the text property associated with the specified text name or text ID.getTextProp
(String name) Get the text property associated with the specified text name or text ID.boolean
Checks if a valid language code is set, i.e.boolean
Checks if automatic translation is enabled from this table.boolean
Checks if automatic translation to this table is enabled.boolean
Checks if entry verification is enabled.boolean
isLanguageCodeSupportedRecursive
(String languageCode) Checks if the specified language code is supported by this text table or any of the derived text tables recursively.boolean
Checks if the table derives another.boolean
Checks if all derived entries must be defined.void
Called when the reference has been broken, i.e.void
onResolved
(Atom refAtom, TextTable target) Called when the reference has been resolved.void
setAutomaticTranslationFromTableEnabled
(boolean on) Sets automatic translation is enabled from this table.void
setAutomaticTranslationToTableEnabled
(boolean on) Checks if automatic translation to this table is enabled.void
setDescription
(String descr) Sets the description of this text table.void
setEntryVerificationEnabled
(boolean on) Sets if entry verification is enabled.void
setLanguageCode
(String languageCode) Sets a valid language code.void
setMustDefineDerivedEntries
(boolean on) Sets if all derived entries must be defined.boolean
Checks if this referencing Property Container has single or multiple referencing properties at maximum.Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, getValueClasses, getVSReference, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPropTreeInitialized, onRemoteEvent, removePropError, removePropListener, renameProp, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toElementString, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropType, validatePropValue, verify, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
addProp, addProp, addProp2, addProp2, canRequestFocus, canRequestFocus, canRequestFocus, containsProp, containsProp, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, enablePropCommunication, enablePropHashMap, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsError, getExtendsName, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropCnr, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getString, getString, getString, getString, hasFocus, initializeExtendsFramework, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsRoot, isPropAddRemoveAllowed, isPropExtended, isSibling, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, requestFocus, requestFocusEx, setBool, setBool, setBool, setBool, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, usePropHashMap, usesPropIndex, validateClassInstances
Field Details
AUTO_TRANSLATE_TO
Constant for the atom name of the property: automatic translation to this table.- See Also:
AUTO_TRANSLATE_FROM
Constant for the atom name of the property: automatic translation from this table.- See Also:
MUST_DEFINE
Constant for the atom name of the property: must defined every derived entry.- See Also:
VERIFY
Constant for the atom name of the property: enable verification of entries.- See Also:
EMPTY_ARRAY
An empty array.
Constructor Details
TextTable
protected TextTable()Creates the text table property container without a name. The name must be set in all cases using thesetPropertyAtom
call.TextTable
Creates the text table with the specified name. All system-reserved names for components begins with "$".- Parameters:
propertyAtom
- the name of the component, unique within it's parent.
Method Details
clone
Clone must be overridden.getReferenceType
Gets the reference Type.- Specified by:
getReferenceType
in interfaceIReferencingPropCnr
- Returns:
IPropReference.RefType.TextTable
.
usesMultipleReferencing
public boolean usesMultipleReferencing()Checks if this referencing Property Container has single or multiple referencing properties at maximum.- Specified by:
usesMultipleReferencing
in interfaceIReferencingPropCnr
- Returns:
- Always
false
as only a single referencing property is supported. Use the methodgetReferencingProp()
to retrieve it.
getReferencingProp
Gets the single potential instance of a referencing property instance.- Specified by:
getReferencingProp
in interfaceIReferencingPropCnr
- Returns:
- The single referencing property, or
null
if none is found.
getReferencingProps
Gets the array of referencing property instances.- Specified by:
getReferencingProps
in interfaceIReferencingPropCnr
- Returns:
- Always
null
as there is only support for a single referencing property. Use the methodgetReferencingProp()
to retrieve it.
onResolved
Called when the reference has been resolved.- Specified by:
onResolved
in interfaceIReferenceOwner<TextTable>
- Parameters:
refAtom
- The atom of the reference property.target
- The target reference.
onBroken
Called when the reference has been broken, i.e. unresolved.- Specified by:
onBroken
in interfaceIReferenceOwner<TextTable>
- Parameters:
refAtom
- The atom of the reference property.target
- The target reference.
getDerivesReference
Gets the text table reference string that this tables derives.- Returns:
- The reference string, or null for no table derived.
getDerives
Gets the text table that is derived.- Returns:
- The derived table, or null for none (or reference not found).
getDerivedTextTables
Gets all tables in all open projects that derives from this text table.The return value is cached for subsequent calls to the method.
- Returns:
- An array of all derived tables, in runtime always empty, only defined in the Designer!
getAllDerivedTextTablesRecursive
Gets all tables in all open projects that derives from this text table and also the ones deriving from a derived text table recursively.The return value is cached for subsequent calls to the method.
- Returns:
- An array of all derived tables, in runtime always empty, only defined in the Designer!
getDerivedTextTable
Gets the derived text table to this text table with the specified language code.- Parameters:
languageCode
- The language code is case insensitive.- Returns:
- The derived text table, or null if not found.
getAllLanguagesMapRecursive
Gets the language map recursively. The search starts with this text tables language code, and if defined, it is added to the map. Then all derived text tables are added for their language codes recursively and if present, they are added to the map if the language code was absent.This value is cached for subsequent calls to the method.
- Returns:
- An unmodifiable map of all supported languages with its text tables, where the keys are the Language Code in LOWER CASE.
getDerivedTextTableRecursive
Gets the derived text table to this text table with the specified language code recursively, searching the chain of derived table, derived-derived tables, and so on.- Parameters:
languageCode
- The language code is case insensitive.- Returns:
- The derived text table, or null if not found.
getAllLanguageCodesRecursive
Gets all the language codes supported by this text table and the derived text tables recursively.The return value is cached for subsequent calls to the method.
- Returns:
- An array of language codes.
isLanguageCodeSupportedRecursive
Checks if the specified language code is supported by this text table or any of the derived text tables recursively.- Parameters:
languageCode
- The language code to look-up is case insensitive.- Returns:
true
if the language code is supported by any of the text tables,false
if not supported.
getTextID
Gets the text entry in this table. If the text is not found, the derived table is verified in order, recursing upwards to the base derived text table.- Parameters:
id
- The text ID to look-up.- Returns:
- The text string or
null
if not found.
getTextID
Gets the text entry in this table. If the text is not found, the derived table is verified in order, recursing upwards to the base derived text table.- Parameters:
id
- The text ID to look-up.fallback
- The fallback text if text ID is not found.- Returns:
- The text string or
fallback
if not found.
getTextID
Gets the text entry with the specified ID for a language. The specific language code is first looked up from the text tables that derives from this text table, then it falls back on the derived tables in order recursively until the base text table is found.- Parameters:
id
- The text ID to look-up.languageCode
- The language code, or {code null} for this table.- Returns:
- The text string or
null
if not found.
getTextID
Gets the text entry with the specified ID for a language. The specific language code is first looked up from the text tables that derives from this text table, then it falls back on the derived tables in order recursively until the base text table is found.- Parameters:
id
- The text ID to look-up.languageCode
- The language code, or {code null} for this table.fallback
- The fallback text if text ID is not found.- Returns:
- The text string or
fallback
if not found.
getPlainTextID
Gets the text entry in this table. If the text is not found, the derived table is verified in order, recursing upwards to the base derived text table.- Parameters:
id
- The text ID to look-up.infoProvider
- The KString info provider to resolve a KString to a plain string, ornull
for none.- Returns:
- The text string or
null
if not found.
getPlainTextID
Gets the text entry in this table. If the text is not found, the derived table is verified in order, recursing upwards to the base derived text table.- Parameters:
id
- The text ID to look-up.fallback
- The fallback text if text ID is not found.infoProvider
- The KString info provider to resolve a KString to a plain string, ornull
for none.- Returns:
- The text string or
fallback
if not found.
getPlainTextID
public String getPlainTextID(String id, String languageCode, String fallback, IKStringInfoProvider infoProvider) Gets the text entry with the specified ID for a language. The specific language code is first looked up from the text tables that derives from this text table, then it falls back on the derived tables in order recursively until the base text table is found.- Parameters:
id
- The text ID to look-up.languageCode
- The language code, or {code null} for this table.fallback
- The fallback text if text ID is not found.infoProvider
- The KString info provider to resolve a KString to a plain string, ornull
for none.- Returns:
- The text string or
fallback
if not found.
getKStringProp
Gets the text entry in this table. If the text is not found, the derived table is verified in order upwards the chain recursively until the base text table is found.- Parameters:
id
- The text ID to look-up.- Returns:
- The text string or null if not found.
getKStringProp
Gets the text entry with the specified ID for a language. The specific language code is first looked up from the text tables that derives from this text table, then it falls back on the derived tables in order recursively until the base text table is found.- Parameters:
id
- The text ID to look-up.languageCode
- The language code, or null for this table.- Returns:
- The text string or null if not found.
getDescription
Gets the description of this text table.setDescription
Sets the description of this text table.- Parameters:
descr
- The description text, non-null.
getLanguageCode
Gets the language for this text table.- Returns:
- The language code in proper case (not all in lower case), or
null
for none.
setLanguageCode
Sets a valid language code.- Parameters:
languageCode
- The language code is case insensitive, non-null.- Throws:
IllegalArgumentException
- If the language code is not valid.
hasLanguageCode
public boolean hasLanguageCode()Checks if a valid language code is set, i.e. not null or empty. This means a generic language or auto-detect for auto-translate.- Returns:
true
if the language code is defined and not empty string,false
otherwise.
getLanguageDescription
Gets the language description for the language of this text table.- Returns:
- The language description, or null for none (or invalid language code).
setAutomaticTranslationFromTableEnabled
public void setAutomaticTranslationFromTableEnabled(boolean on) Sets automatic translation is enabled from this table.- Parameters:
on
- The enabled flag.
isAutomaticTranslationFromTableEnabled
public boolean isAutomaticTranslationFromTableEnabled()Checks if automatic translation is enabled from this table.setAutomaticTranslationToTableEnabled
public void setAutomaticTranslationToTableEnabled(boolean on) Checks if automatic translation to this table is enabled.- Parameters:
on
- The enabled flag.
isAutomaticTranslationToTableEnabled
public boolean isAutomaticTranslationToTableEnabled()Checks if automatic translation to this table is enabled.isTableDerived
public boolean isTableDerived()Checks if the table derives another.- Returns:
- true if configured for table derivation AND the derived table is found.
setMustDefineDerivedEntries
public void setMustDefineDerivedEntries(boolean on) Sets if all derived entries must be defined.- Parameters:
on
- The enabling flag.
mustDefineDerivedEntries
public boolean mustDefineDerivedEntries()Checks if all derived entries must be defined.setEntryVerificationEnabled
public void setEntryVerificationEnabled(boolean on) Sets if entry verification is enabled.- Parameters:
on
- The enabling flag.
isEntryVerificationEnabled
public boolean isEntryVerificationEnabled()Checks if entry verification is enabled.getText
Get the text associated with the specified text name or text ID.- Parameters:
name
- The name of the text or text ID.- Returns:
- The associated text, null for not found.
getTextProp
Get the text property associated with the specified text name or text ID.- Parameters:
atom
- The atom of the text or text ID.- Returns:
- The associated text, null for not found.
getTextProp
Get the text property associated with the specified text name or text ID.- Parameters:
name
- The name of the text or text ID.- Returns:
- The associated text, null for not found.