|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--upidiff.i18n.Catalog
This class represents a language catalog.
Nested Class Summary | |
private class |
Catalog.CatalogFilenameFilter
Filename filter for catalog files. |
Field Summary | |
private Language[] |
availableLanguages
List of available languages. |
private Language |
currentLanguage
Currently selected language. |
private static Catalog |
instance
Global Catalog instance. |
private List |
listeners
List of CatalogListeners. |
private ResourceBundle |
resource
The language catalog backend. |
Constructor Summary | |
private |
Catalog()
Constructs a new Catalog object. |
Method Summary | |
void |
addCatalogListener(CatalogListener listener)
Registers a CatalogListener. |
Language[] |
getAvailableLanguages()
Queries the available languages. |
Language |
getCurrentLanguage()
Returns the currently selected language. |
static Catalog |
getInstance()
Returns a reference to the global Catalog instance. |
String |
getString(String identifier)
Queries the catalog string for the given identifer. |
boolean |
hasString(String identifier)
Checks if the given identifer is present in the catalog. |
private String[] |
lookupCatalogFiles(String resourcePath)
Looks up the install catalog files. |
void |
removeCatalogListener(CatalogListener listener)
Unregisters a CatalogListener. |
void |
setCurrentLanguage(Language language)
Sets the language to be used by the Catalog. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Language[] availableLanguages
getAvailableLanguages()
private Language currentLanguage
getCurrentLanguage()
private List listeners
addCatalogListener(upidiff.i18n.CatalogListener)
,
removeCatalogListener(upidiff.i18n.CatalogListener)
private ResourceBundle resource
ResourceBundle
private static Catalog instance
getInstance()
Constructor Detail |
private Catalog() throws NoLanguagesFound
getInstance()
to obtain
a reference to the global Catalog instance.
NoLanguagesFound
- This exception is thrown if no language
catalogs can be found, neither in the system
nor in the Jar archive.getInstance()
Method Detail |
private String[] lookupCatalogFiles(String resourcePath)
resourcePath
- Resource path to the directory that contains
the catalog files.
public static Catalog getInstance() throws NoLanguagesFound
NoLanguagesFound
- This exception is thrown if no language
catalogs can be found, neither in the system
nor in the Jar archive.instance
public Language[] getAvailableLanguages()
public Language getCurrentLanguage()
public void setCurrentLanguage(Language language) throws InvalidLanguage
language
- The new language to set.
InvalidLanguage
- This exception is thrown if the supplied
Language was not valid or if the language
catalog file could not be loaded due to some
system error (e.g. the user could have deleted
the language catalog file). In this case the
current language is not changed.public String getString(String identifier)
identifier
- Unique identifier for a catalog string.
public boolean hasString(String identifier)
identifier
- Unique identifer for a catalog string.
public void addCatalogListener(CatalogListener listener)
listener
- New CatalogListener to register.removeCatalogListener(upidiff.i18n.CatalogListener)
public void removeCatalogListener(CatalogListener listener)
listener
- CatalogListener to unregister.addCatalogListener(upidiff.i18n.CatalogListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |