public class Bundle extends Object
Bundle.getString(bundleName, key)
to obtain string from bundle.
Then test cases can be executed on different than English locale because
getString()
methods returns string according to current locale.
// "OK" Bundle.getString("org.netbeans.core.windows.services.Bundle", "OK_OPTION_CAPTION"); // "Properties of AnObject" Bundle.getString("org.netbeans.core.Bundle", "CTL_FMT_LocalProperties", new Object[] {Integer.valueOf(1), "AnObject"}); // "View" Bundle.getStringTrimmed("org.netbeans.core.Bundle", "Menu/View");
Modifier and Type | Method and Description |
---|---|
static ResourceBundle |
getBundle(String bundle)
Returns ResourceBundle from specified path.
|
static String |
getString(ResourceBundle bundle,
String key)
Gets string from specified ResourceBundle.
|
static String |
getString(ResourceBundle bundle,
String key,
Object[] params)
Gets string from bundle specified by path to bundle and format it.
|
static String |
getString(String bundle,
String key)
Gets string from bundle specified by path to bundle.
|
static String |
getString(String bundle,
String key,
Object[] params)
Gets string from bundle specified by path to bundle and format it.
|
static String |
getStringTrimmed(String bundle,
String key)
Gets string from bundle, removes mnemonic (i.e.
|
static String |
getStringTrimmed(String bundle,
String key,
Object[] params)
Gets string from bundle and formats it.
|
public static ResourceBundle getBundle(String bundle)
bundle
- path to bundle (e.g. "org.netbeans.core.Bundle")public static String getString(ResourceBundle bundle, String key)
bundle
- instance of ResourceBundlekey
- key of requested stringpublic static String getString(ResourceBundle bundle, String key, Object[] params)
bundle
- path to bundle (e.g. "org.netbeans.core.Bundle")key
- key of requested stringparams
- parameters to be formattedpublic static String getString(String bundle, String key)
bundle
- path to bundle (e.g. "org.netbeans.core.Bundle")key
- key of requested stringpublic static String getStringTrimmed(String bundle, String key)
bundle
- path to bundle (e.g. "org.netbeans.core.Bundle")key
- key of requested stringpublic static String getString(String bundle, String key, Object[] params)
bundle
- path to bundle (e.g. "org.netbeans.core.Bundle")key
- key of requested stringparams
- parameter to be formattedpublic static String getStringTrimmed(String bundle, String key, Object[] params)
bundle
- path to bundle (e.g. "org.netbeans.core.Bundle")key
- key of requested stringparams
- parameter to be formatted