|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jeters.util.AssistedTranslatable
public class AssistedTranslatable
superclass easing internationalization for its subclasses.
Subclasses will not have to implement the methods of the Translatable
interface themselves and can simply access language-specific strings by
calling str("myStringKey")
. Strings with parameters can be
accessed using the second str-method (with varargs).
For instructions on creating and naming language ressource files, see
Translatable
.
The functionality from this class is also included in
AssistedComponent
.
Constructor Summary | |
---|---|
AssistedTranslatable()
|
Method Summary | |
---|---|
void |
setLanguageResourceBundle(java.util.ResourceBundle langRB)
sets the ResourceBundle that contains the messages to use |
protected java.lang.String |
str(java.lang.String key)
returns the language-specific string identified by the given key |
protected java.lang.String |
str(java.lang.String key,
java.lang.Object... arguments)
returns the language-specific string identified by the given key and replaces placeholders ({0}, {1}, ...) in the string with the arguments |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssistedTranslatable()
Method Detail |
---|
public void setLanguageResourceBundle(java.util.ResourceBundle langRB)
Translatable
setLanguageResourceBundle
in interface Translatable
langRB
- ResourceBundle to retrieve Strings fromprotected java.lang.String str(java.lang.String key)
key
- string identifier used in the properties files
protected java.lang.String str(java.lang.String key, java.lang.Object... arguments)
key
- string identifier used in the properties filesarguments
- object whose .toString() output is used to replace
placeholders in the string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |