|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.util.ResourceBundleUtil
public class ResourceBundleUtil
This is a convenience wrapper for accessing resources stored in a ResourceBundle.
| Constructor Summary | |
|---|---|
ResourceBundleUtil(java.util.ResourceBundle r)
Creates a new ResouceBundleUtil which wraps the provided resource bundle. |
|
| Method Summary | |
|---|---|
void |
configureAction(javax.swing.Action action,
java.lang.String argument)
|
void |
configureMenu(javax.swing.JMenuItem menu,
java.lang.String argument)
|
java.lang.String |
format(java.lang.String key,
java.lang.Object... arguments)
Returns a formatted string using java.util.Formatter(). |
javax.swing.KeyStroke |
getAcc(java.lang.String key)
Get a KeyStroke from the ResourceBundle. |
java.lang.String |
getFormatted(java.lang.String key,
java.lang.Object... arguments)
Returns a formatted string using javax.text.MessageFormat. |
javax.swing.ImageIcon |
getImageIcon(java.lang.String key,
java.lang.Class baseClass)
Get an image icon from the ResourceBundle. |
javax.swing.KeyStroke |
getKeyStroke(java.lang.String key)
Get a KeyStroke from the ResourceBundle. |
static ResourceBundleUtil |
getLAFBundle(java.lang.String baseName)
Get the appropriate ResourceBundle subclass. |
char |
getMnem(java.lang.String key)
Get a Mnemonic from the ResourceBundle. |
char |
getMnemonic(java.lang.String key)
Get a Mnemonic from the ResourceBundle. |
java.lang.String |
getString(java.lang.String key)
Get a String from the ResourceBundle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceBundleUtil(java.util.ResourceBundle r)
| Method Detail |
|---|
public java.lang.String getString(java.lang.String key)
key - The key of the property.
public javax.swing.ImageIcon getImageIcon(java.lang.String key,
java.lang.Class baseClass)
key - The key of the property.
public char getMnemonic(java.lang.String key)
key - The key of the property.
public char getMnem(java.lang.String key)
key - The key of the property. This method appends "Mnem" to the key.
public javax.swing.KeyStroke getKeyStroke(java.lang.String key)
key - The key of the property.
javax.swing.KeyStroke.getKeyStroke(value).
Returns null if the property is missing.public javax.swing.KeyStroke getAcc(java.lang.String key)
key - The key of the property. This method adds "Acc" to the key.
javax.swing.KeyStroke.getKeyStroke(value).
Returns null if the property is missing.
public java.lang.String getFormatted(java.lang.String key,
java.lang.Object... arguments)
key - arguments -
public java.lang.String format(java.lang.String key,
java.lang.Object... arguments)
key - arguments -
public static ResourceBundleUtil getLAFBundle(java.lang.String baseName)
throws java.util.MissingResourceException
java.util.MissingResourceExceptionResourceBundle
public void configureAction(javax.swing.Action action,
java.lang.String argument)
public void configureMenu(javax.swing.JMenuItem menu,
java.lang.String argument)
|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||