|
Sky View Café - Java | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceProvider
Method Summary | |
---|---|
void |
addChoicesFromResource(JComboBox comboBox,
String key)
Fill in selections choices for a JComboBox using a delimited (as per getStrings(String) resource string. |
String |
format(String patternKey,
Object... args)
Return a formatted string, filled in using a specified list of arguments, as per ExtendedMessageFormat.format(String, Object...) , where the pattern argument
is a resource string matching the specified patternKey . |
int |
getInt(String key)
Return an integer value for the given key. |
int |
getInt(String key,
int errorValue)
Return an integer value for the given key. |
String |
getString(String key)
Return a resource string for the given key. |
String |
getString(String key,
String defaultValue)
Return a resource string for the given key. |
String |
getString(String key,
String defaultValue,
boolean failQuietly)
Return a resource string for the given key. |
String[] |
getStrings(String key)
Return an array of strings parsed from the resource string for the given key. |
String[] |
getStrings(String key,
char delimiter)
Return an array of strings parsed from the resource string for the given key. |
String[] |
getStrings(String key,
char delimiter,
char escapeChar)
Return an array of strings parsed from the resource string for the given key. |
Method Detail |
---|
String getString(String key)
key
- Resource key.
String getString(String key, String defaultValue)
key
- Resource key.defaultValue
- Default return value if resource not found.
defaultValue
if no match is found.String getString(String key, String defaultValue, boolean failQuietly)
key
- Resource key.defaultValue
- Default return value if resource not found.failQuietly
- If true, log no error for unmatched resource key.
defaultValue
if no match is found.String[] getStrings(String key)
Return an array of strings parsed from the resource string for the given key.
The delimiters used to separate multiple string items will be automatically determined as follows, in this order of evaluation:
If none of the above delimiters are found, the resource will be treated as a single string.
key
- Resource key.
String[] getStrings(String key, char delimiter)
key
- Resource key.delimiter
- The delimiter character used to separate individual string items. If the delimiter is either
semicolon (;) or comma (,) backslash (\) is used as an escape character.
String[] getStrings(String key, char delimiter, char escapeChar)
key
- Resource key.delimiter
- The delimiter character used to separate individual string items.escapeChar
- An escape character. If the null character (\0) is specified, no escaping is performed.
int getInt(String key)
key
- Resource key.
int getInt(String key, int errorValue)
key
- Resource key.errorValue
- Value to return for missing or invalid resources.
errorValue
if no match is found
or if the matching resource does not parse as a proper integer.String format(String patternKey, Object... args)
Return a formatted string, filled in using a specified list of arguments, as per
ExtendedMessageFormat.format(String, Object...)
, where the pattern
argument
is a resource string matching the specified patternKey
.
patternKey
- Resource key for a formatting pattern.args
- Values to be applied to the formatting pattern.
MessageFormat.format(String, Object...)
void addChoicesFromResource(JComboBox comboBox, String key)
getStrings(String)
resource string.
comboBox
- Target JComboBox.key
- Resource key of delimited list of choices.
|
Sky View Café - Java | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |