|
org.netbeans.modules.jellytools.platform/3 3.13 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.jellytools.Bundle
public class Bundle
Helper class to get strings from NetBeans Bundle.properties files.
Everytime someone wants to identify a component by its title, label, caption or whatever,
he should not use hard coded string in his test case but he should use
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.
Usage:
// "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[] {new Integer(1), "AnObject"});
// "View"
Bundle.getStringTrimmed("org.netbeans.core.Bundle", "Menu/View");
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
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 string
public 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 formatted
public static String getString(String bundle,
String key)
bundle - path to bundle (e.g. "org.netbeans.core.Bundle")key - key of requested string
public static String getStringTrimmed(String bundle,
String key)
bundle - path to bundle (e.g. "org.netbeans.core.Bundle")key - key of requested string
public 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 formatted
public 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
|
org.netbeans.modules.jellytools.platform/3 3.13 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||