Package java.util

Examples of java.util.ResourceBundle


    }
    StringBuffer sb = new StringBuffer(c.getName());
    sb.insert(sb.lastIndexOf("."),".resources");
    sb.append("Resources");
    try {
      ResourceBundle rb = ResourceBundle.getBundle(sb.toString(),CustomizedLocale.get());
      if (parent!=null) {
        Method method = ResourceBundle.class.getDeclaredMethod("setParent",setParentParameters);
        method.setAccessible(true);
        method.invoke(rb,new Object[]{ parent });
      }
View Full Code Here


    {
        FacesContext context = FacesContext.getCurrentInstance();
        String resourceString;
        try
        {
            final ResourceBundle bundle = ResourceBundle.getBundle(
                    BUNDLE_NAME,
                    context.getViewRoot().getLocale());
            resourceString = bundle.getString(key);
            if (arguments != null)
            {
                final MessageFormat format = new MessageFormat(resourceString,
                        context.getViewRoot().getLocale());
                resourceString = format.format(arguments);
View Full Code Here

        true,
        false,//hasResourceBundle
        false//hasFormatFactory
        );
   
    ResourceBundle resBdl = (ResourceBundle) parameterValues.get(JRParameter.REPORT_RESOURCE_BUNDLE);
    if (resBdl == null)
    {
      JRFillParameter resourceBundleParam = (JRFillParameter) filler.getParametersMap().get(JRParameter.REPORT_RESOURCE_BUNDLE);
      parameterValues.put(JRParameter.REPORT_RESOURCE_BUNDLE, resourceBundleParam.getValue());
    }
View Full Code Here

     *
     * @return localized name
     */
    public String getLocalizedName() {
  try {
      ResourceBundle rb = ResourceBundle.getBundle(resourceBundleName);
      return rb.getString(name);
  } catch (Exception ex) {
      return name;
  }
    }
View Full Code Here

            JBother.settingsDir = System.getProperty("user.home") +  File.separatorChar + ".jbother";
            JBother.profileDir = JBother.settingsDir + File.separatorChar +  "profiles";
        }

        if (Double.parseDouble(buf.toString()) < Double.parseDouble("1.4")) {
            ResourceBundle resources = ResourceBundle.getBundle(
                    "JBotherBundle", Locale.getDefault());

            JOptionPane
                    .showMessageDialog(null,
                            resources.getString("jdk14Needed"), resources
                                    .getString("javaVersionError"),
                            JOptionPane.WARNING_MESSAGE);

            System.exit(1);
        } else {
View Full Code Here

        // Load the resource of the desired locale from resource
        // manager.
        String colString = "";
        try {
            ResourceBundle resource = LocaleData.getCollationData(desiredLocale);

            colString = resource.getString("Rule");
        } catch (MissingResourceException e) {
            // Use default values
        }
        try
        {
View Full Code Here

    /**
     * Look up resource data for the desiredLocale in the cache; update the
     * cache if necessary.
     */
    private static ResourceBundle cacheLookup(Locale desiredLocale) {
  ResourceBundle rb;
  SoftReference data
      = (SoftReference)cachedLocaleData.get(desiredLocale);
  if (data == null) {
      rb = LocaleData.getDateFormatData(desiredLocale);
      data = new SoftReference(rb);
View Full Code Here

  return rb;
    }

    private void initializeData(Locale desiredLocale) {
        int i;
        ResourceBundle resource = cacheLookup(desiredLocale);

        // FIXME: cache only ResourceBundle. Hence every time, will do
        // getObject(). This won't be necessary if the Resource itself
        // is cached.
        eras = (String[])resource.getObject("Eras");
        months = resource.getStringArray("MonthNames");
        shortMonths = resource.getStringArray("MonthAbbreviations");
        String[] lWeekdays = resource.getStringArray("DayNames");
        weekdays = new String[8];
        weekdays[0] = ""// 1-based
        for (i=0; i<lWeekdays.length; i++)
            weekdays[i+1] = lWeekdays[i];
        String[] sWeekdays = resource.getStringArray("DayAbbreviations");
        shortWeekdays = new String[8];
        shortWeekdays[0] = ""// 1-based
        for (i=0; i<sWeekdays.length; i++)
            shortWeekdays[i+1] = sWeekdays[i];
        ampms = resource.getStringArray("AmPmMarkers");
        localPatternChars = resource.getString("DateTimePatternChars");

  locale = desiredLocale;
    }
View Full Code Here

     * Finds the available plugins and uses the PluginLoader to load them Once a
     * plugin is loaded, it's init() method is called so it can execute initial
     * code and register for various events in JBother
     */
    public static void loadPlugins() {
        ResourceBundle resources = ResourceBundle.getBundle("JBotherBundle",
                Locale.getDefault());
       
        loader
                .findPlugins(JBother.settingsDir + File.separatorChar
                + "plugins");
        loader.loadPlugins();
       
        ArrayList invalids = loader.getInvalidPlugins();
        for (int i = 0; i < invalids.size(); i++) {
            String name = (String) invalids.get(i);
            Standard.warningMessage(null, resources.getString("pluginError"),
                    MessageFormat.format(resources
                    .getString("pluginErrorMessage"),
                    new Object[] { name }));
        }
    }
View Full Code Here

            if (providersInstance != null) {
                return providersInstance;
            }
        }

        ResourceBundle bundle = getBundle(
                        "sun.text.resources.BreakIteratorInfo", locale);
        String[] classNames = bundle.getStringArray("BreakIteratorClasses");
       
        String dataFile = bundle.getString(dataName);

        try {
            if (classNames[type].equals("RuleBasedBreakIterator")) {
                return new RuleBasedBreakIterator(dataFile);
            }
            else if (classNames[type].equals("DictionaryBasedBreakIterator")) {
                String dictionaryFile = bundle.getString(dictionaryName);
                return new DictionaryBasedBreakIterator(dataFile, dictionaryFile);
            }
            else {
                throw new IllegalArgumentException("Invalid break iterator class \"" +
                                classNames[type] + "\"");
View Full Code Here

TOP

Related Classes of java.util.ResourceBundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.