public class LocalizableStringValue extends Object implements StringValue
Modifier and Type | Field and Description |
---|---|
private Locale |
locale |
private Map<Object,String> |
lookup |
private String |
prefix |
Constructor and Description |
---|
LocalizableStringValue(Map<Object,String> lookup)
Instantiates a LocaleStringValue which looks up localized String
representations for items in the map using the JComponent defaultLocale.
|
LocalizableStringValue(Map<Object,String> lookup,
Locale locale)
Instantiates a LocaleStringValue which looks up localized String
representations for items in the map using the given Locale.
|
LocalizableStringValue(Map<Object,String> lookup,
String prefix)
Instantiates a LocaleStringValue which looks up localized String
representations for items in the map using the JComponent defaultLocale.
|
LocalizableStringValue(Map<Object,String> lookup,
String prefix,
Locale locale)
Instantiates a LocaleStringValue which looks up localized String
representations for items in the map using the given Locale.
|
Modifier and Type | Method and Description |
---|---|
Locale |
getLocale()
Returns the Locale to use for lookup, guaranteed to be not null.
|
String |
getString(Object value)
Returns a string representation of the given value.
|
void |
setLocale(Locale locale)
Sets the Locale to use for lookup of localized string representation.
|
public LocalizableStringValue(Map<Object,String> lookup)
lookup
- a map containing Entries of objects and a string key to
look up its string representation in the UIManagerpublic LocalizableStringValue(Map<Object,String> lookup, Locale locale)
lookup
- a map containing Entries of objects and a string key to
look up its string representation in the UIManagerlocale
- the locale to lookup the localized strings, may be null to
denote using JComponent.defaultLocalepublic LocalizableStringValue(Map<Object,String> lookup, String prefix)
lookup
- a map containing Entries of objects and a string key to
look up its string representation in the UIManagerprefix
- a common prefix for all string keys in the map, may be null
to denote that the keys should be use as arepublic LocalizableStringValue(Map<Object,String> lookup, String prefix, Locale locale)
lookup
- a map containing Entries of objects and a string key to
look up its string representation in the UIManagerprefix
- a common prefix for all string keys in the map, may be null
to denote that the keys should be use as arelocale
- the locale to lookup the localized strings, may be null to
denote using JComponent.defaultLocalepublic String getString(Object value)
StringValue
PENDING JW: forgot - why not null return guaranteed?
getString
in interface StringValue
value
- the object to present as a stringpublic final void setLocale(Locale locale)
locale
- the locale to lookup the localized strings, may be null to
denote using Locale's default.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses