Package oracle.forms.jdapi
Class TranslationTable
java.lang.Object
oracle.forms.jdapi.TranslationTable
- All Implemented Interfaces:
Iterator
Class representing the translations in a FormModule.
The iterator interface is implemented to allow access to the translations
using the standard iterator methods (hasNext
, next
, and remove
).
MODIFIED (MM/DD/YY)
rgurubha 12/14/04 -- #(4029445) Added Java API wrapTranslatedText() for wrapping of
boilerplate text label.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]
Array of character sets in the translation tableprotected Vector
Array of languages in the translation table held in a Vector. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor called by JdapiModule only -
Method Summary
Modifier and TypeMethodDescriptionint
addTranslation
(String language, int characterSet) Adds a translation to the table.void
deleteTranslation
(String language) Deletes a given language translation from the table.int
getCharacterSet
(String language) Returns a language's corresponding character set.Returns the Module's current language string.getLanguageString
(int characterSet) Returns a character set's corresponding language.Returns theJdapiModule
to which thisTranslationTable
corresponds.Returns a String given its stringID for a specified language.int
Returns the number of used strings in the module's string table.getStringObjectClass
(int stringID) Returns the property number for the string and the given stringIDint
getStringObjectType
(int stringID) Returns the object type for the string at the given stringIDint
getStringPropertyNumber
(int stringID) Returns the property number for the string at the given stringIDvoid
goStart()
Reset the iterator to the start of the language tableboolean
hasNext()
Returns true if the iteration has more elements.boolean
isStringInUse
(int stringID) Queries whether a given String is in use or not.next()
Gets the next object.void
remove()
Removes the current translation in the iterator using deleteTranslation.void
Sets a String given its stringID and languagevoid
wrapTranslatedText
(Graphics pd2fgra, String language) #(4029445) Jdapi for wrapping of boilerplate text needed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
m_langArray
Array of languages in the translation table held in a Vector. -
m_charSetArray
protected int[] m_charSetArrayArray of character sets in the translation table
-
-
Constructor Details
-
TranslationTable
Constructor called by JdapiModule only
-
-
Method Details
-
getModule
Returns theJdapiModule
to which thisTranslationTable
corresponds.- Returns:
- JdapiModule
-
getCharacterSet
Returns a language's corresponding character set.- Parameters:
language
- the Oracle-defined name of the language.- Returns:
- integer corresponding to the Oracle name for the character set.
- Throws:
JdapiIllegalStateException
- if the langauge is not in the table.
-
getLanguageString
Returns a character set's corresponding language.- Parameters:
characterSet
- the Oracle-defined name of the character set.- Returns:
- String for the Oracle-defined name of the language.
-
getCurrentLanguageString
Returns the Module's current language string.- Returns:
- String for the Oracle-defined name of the language.
-
addTranslation
Adds a translation to the table.- Parameters:
language
- the Oracle-defined name of the language.characterSet
- the Oracle-defined name of the character set.- Returns:
- the index of the new translation
-
deleteTranslation
Deletes a given language translation from the table.- Parameters:
language
- the Oracle-defined name of the language.- Throws:
JdapiIllegalStateException
- if the langauge is not in the table.
-
getStringCount
public int getStringCount()Returns the number of used strings in the module's string table.Note that the string array is 1-indexed rather than zero-indexed, so strings for a given language can be processed as follows:
for (int i = 1; i <= fmb.getStringCount(); i++) { String str = fmb.getString(lang, n); ... }
- Returns:
- the number of used strings as an integer.
-
isStringInUse
public boolean isStringInUse(int stringID) Queries whether a given String is in use or not.- Parameters:
stringID
- the integer that indexes the string property in the table for the current language.- Returns:
true
if the String is in use;false
otherwise.
-
getString
Returns a String given its stringID for a specified language.- Parameters:
language
- the Oracle-defined name of the language.stringID
- the integer that indexes the string property in the table for the current language.- Returns:
- String
- Throws:
JdapiIllegalStateException
- if the langauge isn't in the table.
-
setString
Sets a String given its stringID and language- Parameters:
language
- the Oracle-defined name of the language.stringID
- the integer that indexes the string property in the table for the current language.str
- the string property.- Throws:
JdapiIllegalStateException
- if the langauge is not in the table.
-
getStringPropertyNumber
public int getStringPropertyNumber(int stringID) Returns the property number for the string at the given stringID- Parameters:
stringID
- the integer that indexes the string property in the table for the current language.- Returns:
- integer of the property number.
-
getStringObjectType
public int getStringObjectType(int stringID) Returns the object type for the string at the given stringID- Parameters:
stringID
- the integer that indexes the string property in the table for the current language.- Returns:
- int
-
getStringObjectClass
Returns the property number for the string and the given stringID- Parameters:
stringID
- the integer that indexes the string property in the table for the current language.- Returns:
- Class
-
hasNext
public boolean hasNext()Returns true if the iteration has more elements. -
next
Gets the next object. -
goStart
public void goStart()Reset the iterator to the start of the language table -
remove
public void remove()Removes the current translation in the iterator using deleteTranslation. -
wrapTranslatedText
#(4029445) Jdapi for wrapping of boilerplate text needed. Wraps the boilerplate text label. This API must be used when Jdapi is running in Translation mode .- Parameters:
pd2fgra
- Graphics object containing the text to be wrapped.language
- Oracle-defined name of the language.
-