Class AbbreviationTableManager.LanguageAwareAbbreviationTable
- java.lang.Object
-
- ca.cgjennings.ui.textedit.AbbreviationTable
-
- ca.cgjennings.apps.arkham.editors.AbbreviationTableManager.LanguageAwareAbbreviationTable
-
- Enclosing class:
- AbbreviationTableManager
public static class AbbreviationTableManager.LanguageAwareAbbreviationTable extends AbbreviationTable
An abbreviation table that also expands @string and #string (when placed in braces) to user interface and game language strings, respectively. All abbreviation tables returned by the manager are instances of this class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ca.cgjennings.ui.textedit.AbbreviationTable
AbbreviationTable.Expansion
-
-
Constructor Summary
Constructors Constructor Description LanguageAwareAbbreviationTable()
LanguageAwareAbbreviationTable(AbbreviationTable toCopy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
get(java.lang.String abbrev)
Returns the expansion of the abbreviation.Language
getGameLanguage()
Returns the language used to expand game string (#) tags.Language
getInterfaceLanguage()
Returns the language used to expand interface string (@) tags.void
setGameLanguage(Language lang)
Sets the language used to expand game string (#) tags.void
setInterfaceLanguage(Language lang)
Sets the language used to expand interface string (@) tags.-
Methods inherited from class ca.cgjennings.ui.textedit.AbbreviationTable
clear, expandAbbreviation, expandAbbreviation, expandAbbreviation, getMaximumAbbreviationLength, getParent, keySet, load, load, load, load, put, remove, setParent, size, store, store, store
-
-
-
-
Constructor Detail
-
LanguageAwareAbbreviationTable
public LanguageAwareAbbreviationTable()
-
LanguageAwareAbbreviationTable
public LanguageAwareAbbreviationTable(AbbreviationTable toCopy)
-
-
Method Detail
-
get
public java.lang.String get(java.lang.String abbrev)
Description copied from class:AbbreviationTable
Returns the expansion of the abbreviation. If an abbreviation is not defined by this table, thennull
is returned unless this table has a parent. If it has a parent, then the parent's expansion for the abbreviation is returned as if by callinggetParent().get( abbrev )
.- Overrides:
get
in classAbbreviationTable
- Parameters:
abbrev
- the abbreviation to expand- Returns:
- the expansion, or
null
if none is defined - See Also:
AbbreviationTable.put(java.lang.String, java.lang.String)
,AbbreviationTable.setParent(ca.cgjennings.ui.textedit.AbbreviationTable)
-
setGameLanguage
public void setGameLanguage(Language lang)
Sets the language used to expand game string (#) tags. The default language isLanguage.getGame()
.- Parameters:
lang
- the non-null
language to use- See Also:
getGameLanguage()
-
getGameLanguage
public Language getGameLanguage()
Returns the language used to expand game string (#) tags. The default language isLanguage.getGame()
.- Returns:
- the game language used by the table
- See Also:
setGameLanguage(resources.Language)
-
setInterfaceLanguage
public void setInterfaceLanguage(Language lang)
Sets the language used to expand interface string (@) tags. The default language isLanguage.getInterface()
.- Parameters:
lang
- the non-null
language to use- See Also:
getInterfaceLanguage()
-
getInterfaceLanguage
public Language getInterfaceLanguage()
Returns the language used to expand interface string (@) tags. The default language isLanguage.getInterface()
.- Returns:
- the game language used by the table
- See Also:
setInterfaceLanguage(resources.Language)
-
-