|
jWorkSheet release 0.90 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ponec.jworksheet.core.LanguageManager
public class LanguageManager
Tool provide two services
First: in the debug mode it display to user a language property parameters
from top hierarchy komponent to down recursively.
Second: allways set Name parameter (if one is not only assigned) for all compoments.
Examples for JFrame:
Note 1: For new JLabel("Label") -> jLabel.setName("~Label"); // Default usage
Note 2: jLabel.setName(".myPrefix.Label"); // User usage
Note 3: jLabel.setName("#"); // Ignore It
Field Summary | |
---|---|
protected java.awt.Container |
basicContainer
Top level container. |
protected java.util.WeakHashMap<java.util.Locale,java.util.ResourceBundle> |
bundleMap
Bundle like weak map. |
protected java.lang.String |
bundleName
Basic Bundle Name. |
static boolean |
DEBUG_MODE
Debug Mode |
static java.util.Locale |
DEFAULT_LOCALE
A Locale for default property: |
static boolean |
enableTiming
Attribute for enable timing (outupt to console). |
protected boolean |
firstRuning
The first conversion. |
protected java.util.Locale |
locale
Locale |
static java.lang.String |
STOP_TRANSLATION
A key word to skipping a generic translation for marked component. |
Constructor Summary | |
---|---|
LanguageManager(java.awt.Container basicContainer,
java.lang.Class bundlePattern,
boolean showDebugWindow)
Creates new LanguageManager class. |
Method Summary | |
---|---|
java.util.Locale |
getLocale()
Return current locale: |
java.lang.String |
getText(java.lang.Class anOwnerClass,
java.lang.String key,
java.util.Locale aLocale)
Language Sensitive Text. |
java.lang.String |
getText(java.lang.String key)
Language Sensitive Text. |
java.lang.String |
getText(java.lang.String key,
boolean exception)
Language Sensitive Text. |
java.lang.String |
getText(java.lang.String key,
java.lang.Object... parameters)
Language Sensitive Text. |
java.lang.String |
getText(java.lang.String key,
java.lang.Object parameter)
Language Sensitive Text. |
java.lang.String |
getTextAllways(java.lang.Class anOwnerClass,
java.lang.String key,
java.util.Locale aLocale)
Language Sensitive Text. |
java.lang.String |
getTextAllways(java.lang.Class anOwnerClass,
java.lang.String key,
java.lang.String[] parameters,
java.util.Locale aLocale)
Language Sensitive Text. |
java.lang.String |
getTextAllways(java.lang.String key)
Language Sensitive Text. |
java.lang.String |
getTextAllways(UjoProperty key)
Language Sensitive Text. |
void |
setFirstRunTexts(java.awt.Container topContainer)
Create an key Name for the param container and their subcomponents for the first run. |
void |
setFirstRunTexts(java.awt.Container topContainer,
java.util.Locale aLocale)
Create an key Name for the param container and their subcomponents for the first run. |
void |
setLocale(java.util.Locale locale,
boolean changeGuiText)
Create an key Name for the param container and their subcomponents. |
void |
setLocaleAndTranslate(java.util.Locale locale,
boolean translate)
Set new locale and change texts in GUI on the top container and his subcomponents. |
void |
setTexts(java.util.Locale locale,
java.awt.Container topContainer)
Create an key Name for the top container and their subcomponents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STOP_TRANSLATION
public static final java.util.Locale DEFAULT_LOCALE
public static final boolean DEBUG_MODE
public static final boolean enableTiming
protected java.awt.Container basicContainer
protected java.lang.String bundleName
protected java.util.WeakHashMap<java.util.Locale,java.util.ResourceBundle> bundleMap
protected java.util.Locale locale
protected boolean firstRuning
Constructor Detail |
---|
public LanguageManager(java.awt.Container basicContainer, java.lang.Class bundlePattern, boolean showDebugWindow)
basicContainer
- Parameter is default Root. It is used alse for PROPERTY file name.bundlePattern
- A bundlePattern class determine a bundle name.showDebugWindow
- Method Detail |
---|
public void setFirstRunTexts(java.awt.Container topContainer)
topContainer
- A root of the component tree.public void setFirstRunTexts(java.awt.Container topContainer, java.util.Locale aLocale)
topContainer
- A root of the component tree.public void setLocaleAndTranslate(java.util.Locale locale, boolean translate)
locale
- The Languagepublic void setLocale(java.util.Locale locale, boolean changeGuiText)
locale
- The LanguagechangeGuiText
- if value is false, don't change text on a GUI containter.public void setTexts(java.util.Locale locale, java.awt.Container topContainer)
locale
- topContainer
- If the Continer is null, only locale is assigned.public java.lang.String getText(java.lang.Class anOwnerClass, java.lang.String key, java.util.Locale aLocale)
key
-
public java.lang.String getTextAllways(java.lang.Class anOwnerClass, java.lang.String key, java.util.Locale aLocale)
key
-
public java.lang.String getTextAllways(java.lang.Class anOwnerClass, java.lang.String key, java.lang.String[] parameters, java.util.Locale aLocale)
key
-
public java.lang.String getText(java.lang.String key, boolean exception) throws java.util.MissingResourceException
key
-
java.util.MissingResourceException
public java.lang.String getText(java.lang.String key)
key
-
public java.lang.String getTextAllways(UjoProperty key)
key
-
public java.lang.String getTextAllways(java.lang.String key)
key
-
public java.lang.String getText(java.lang.String key, java.lang.Object... parameters)
key
- parameters
- Any parameters of the message.
public java.lang.String getText(java.lang.String key, java.lang.Object parameter)
key
- parameter
- The one parameter of the message.
public java.util.Locale getLocale()
|
jWorkSheet release 0.90 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |