当前位置: 首页>>代码示例>>Java>>正文


Java CoreResourceBundleControl类代码示例

本文整理汇总了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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:LWCToolkit.java

示例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");
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:Bug6299235Test.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:Toolkit.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:UIDefaults.java

示例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;
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:11,代码来源:Toolkit.java

示例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;
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:11,代码来源:Toolkit.java

示例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;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:38,代码来源:UIDefaults.java

示例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;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:16,代码来源:LWCToolkit.java


注:本文中的sun.util.CoreResourceBundleControl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。