本文整理汇总了Java中sun.util.CoreResourceBundleControl类的典型用法代码示例。如果您正苦于以下问题:Java CoreResourceBundleControl类的具体用法?Java CoreResourceBundleControl怎么用?Java CoreResourceBundleControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CoreResourceBundleControl类属于sun.util包,在下文中一共展示了CoreResourceBundleControl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
@Override
public ResourceBundle run() {
ResourceBundle platformResources = null;
try {
platformResources =
ResourceBundle.getBundle("sun.awt.resources.awtosx",
CoreResourceBundleControl.getRBControlInstance());
} catch (MissingResourceException e) {
// No resource file; defaults will be used.
}
System.loadLibrary("awt");
System.loadLibrary("fontmanager");
return platformResources;
}
示例2: main
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
/* Try to load "sun.awt.resources.awt_ru_RU.properties which
* is in awtres.jar.
*/
ResourceBundle russionAwtRes = ResourceBundle.getBundle("sun.awt.resources.awt",
new Locale("ru", "RU"),
CoreResourceBundleControl.getRBControlInstance());
/* If this call throws MissingResourceException, the test fails. */
if (russionAwtRes != null) {
String result = russionAwtRes.getString("foo");
if (result.equals("bar")) {
System.out.println("Bug6299235Test passed");
} else {
System.err.println("Bug6299235Test failed");
throw new Exception("Resource found, but value of key foo is not correct\n");
}
}
}
示例3: run
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
public Void run() {
try {
resources =
ResourceBundle.getBundle("sun.awt.resources.awt",
CoreResourceBundleControl.getRBControlInstance());
} catch (MissingResourceException e) {
// No resource file; defaults will be used.
}
return null;
}
示例4: getResourceCache
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
/**
* Returns a Map of the known resources for the given locale.
*/
private Map<String, Object> getResourceCache(Locale l) {
Map<String, Object> values = resourceCache.get(l);
if (values == null) {
values = new TextAndMnemonicHashMap();
for (int i=resourceBundles.size()-1; i >= 0; i--) {
String bundleName = resourceBundles.get(i);
try {
Control c = CoreResourceBundleControl.getRBControlInstance(bundleName);
ResourceBundle b;
if (c != null) {
b = ResourceBundle.getBundle(bundleName, l, c);
} else {
b = ResourceBundle.getBundle(bundleName, l);
}
Enumeration keys = b.getKeys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
if (values.get(key) == null) {
Object value = b.getObject(key);
values.put(key, value);
}
}
} catch( MissingResourceException mre ) {
// Keep looking
}
}
resourceCache.put(l, values);
}
return values;
}
示例5: run
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
public Object run() {
try {
resources =
ResourceBundle.getBundle("sun.awt.resources.awt",
CoreResourceBundleControl.getRBControlInstance());
} catch (MissingResourceException e) {
// No resource file; defaults will be used.
}
return null;
}
示例6: run
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
public Object run() {
try {
resources =
ResourceBundle.getBundle("sun.awt.resources.awt",
CoreResourceBundleControl.getRBControlInstance());
} catch (MissingResourceException e) {
// No resource file; defaults will be used.
}
return null;
}
示例7: getResourceCache
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
/**
* Returns a Map of the known resources for the given locale.
*/
private Map<String, Object> getResourceCache(Locale l) {
Map<String, Object> values = resourceCache.get(l);
if (values == null) {
values = new HashMap<String, Object>();
for (int i=resourceBundles.size()-1; i >= 0; i--) {
String bundleName = resourceBundles.get(i);
try {
Control c = CoreResourceBundleControl.getRBControlInstance(bundleName);
ResourceBundle b;
if (c != null) {
b = ResourceBundle.getBundle(bundleName, l, c);
} else {
b = ResourceBundle.getBundle(bundleName, l);
}
Enumeration keys = b.getKeys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
if (values.get(key) == null) {
Object value = b.getObject(key);
values.put(key, value);
}
}
} catch( MissingResourceException mre ) {
// Keep looking
}
}
resourceCache.put(l, values);
}
return values;
}
示例8: run
import sun.util.CoreResourceBundleControl; //导入依赖的package包/类
public ResourceBundle run() {
ResourceBundle platformResources = null;
try {
platformResources =
ResourceBundle.getBundle("sun.awt.resources.awtosx",
CoreResourceBundleControl.getRBControlInstance());
} catch (MissingResourceException e) {
// No resource file; defaults will be used.
}
System.loadLibrary("awt");
System.loadLibrary("fontmanager");
return platformResources;
}