Package java.util

Examples of java.util.ResourceBundle$MissingBundle


        ListResourceBundle lrb;

        try
        {

            ResourceBundle rb =
                ResourceBundle.getBundle(m_resourceBundleName, locale);
            lrb = (ListResourceBundle) rb;
        }
        catch (MissingResourceException e)
        {
View Full Code Here


   * @return the resource bundle for the given base name and locale
   * @see ResourceBundle#getBundle(String, Locale, ClassLoader)
   */
  public static ResourceBundle loadResourceBundle(String baseName, Locale locale, ClassLoader clsLoader)
  {
    ResourceBundle resourceBundle = null;
   
    ClassLoader classLoader = getClassLoader(clsLoader);
    if (classLoader != null)
    {
      try
View Full Code Here

      }
      return messages.get(key);
    }

    public Enumeration<String> getKeys() {
      ResourceBundle parent = this.parent;
      return new ResourceBundleEnumeration(messages.keySet(),
          (parent != null) ? parent.getKeys() : null);
    }
View Full Code Here

    }

    private void loadBundles(Locale locale) {
      messages = new HashMap<String, Object>();
      for (String bundleName : getBundleNames(baseName)) {
        ResourceBundle bundle = ResourceBundle.getBundle(bundleName,
            locale);
        Enumeration<String> keys = bundle.getKeys();
        while (keys.hasMoreElements()) {
          String key = keys.nextElement();
          messages.put(key, bundle.getObject(key));
        }
      }
    }
View Full Code Here

  /**
   * Loads the resource bundle corresponding to the resource bundle base name and locale.
   */
  protected ResourceBundle loadResourceBundle()
  {
    ResourceBundle loadedBundle;
    if (resourceBundleBaseName == null)
    {
      loadedBundle = null;
    }
    else
View Full Code Here

    // copy the main report's resource bundle if the subdataset has no
    // resource bundle of its own
    if (!parameterValues.containsKey(JRParameter.REPORT_RESOURCE_BUNDLE)
        && tableReport.getResourceBundle() == null)
    {
      ResourceBundle resourceBundle = (ResourceBundle) filler.getParameterValuesMap().get(
          JRParameter.REPORT_RESOURCE_BUNDLE);
      if (resourceBundle != null)
      {
        parameterValues.put(JRParameter.REPORT_RESOURCE_BUNDLE, resourceBundle);
      }
View Full Code Here

  private String translate(Object messageObject, Locale locale) {
    if (null == messageObject) {
      return null;
    }
    String message = messageObject.toString();
    ResourceBundle bundleEn = ResourceBundle.getBundle(getResourceBundleName(), Locale.ENGLISH);
    ResourceBundle bundle = bundleEn;
    if (null != locale) {
      try {

        bundle = ResourceBundle.getBundle(getResourceBundleName(), locale);
      } catch (MissingResourceException mre) {
        // ignore, bundle is already set to English
      }
    }
    Object obj;
    try {
      obj = bundle.getObject(message);
    } catch (MissingResourceException mre) {
      obj = bundleEn.getObject(message);
    }
    if (null != obj && obj instanceof String) {
      return (String) obj;
View Full Code Here

    /**
     * @param key Resource key
     * @return String from the plug-in's resource bundle, or 'key' if not found.
     */
    public static String getResourceString(String key) {
        ResourceBundle bundle = ProsePlugin.getDefault().getResourceBundle();
        try {
            return (bundle != null) ? bundle.getString(key) : key;
        } catch (MissingResourceException e) {
            return key;
        }
    }
View Full Code Here

    /**
     * @inheritDoc
     */
    public void configure() throws Exception {

        ResourceBundle b = null;
        // Initialisation des propri�t� de Velocity
        if(this.configurationFilename == null){
            b = ResourceBundle.getBundle(DEFAULT_CONFIG_RESOURCE);
        }
        else {
            b = ResourceBundle.getBundle(getConfigurationFilename());
        }
       
        if(getTemplateDirectory() == null){
            setTemplateDirectory(DEFAULT_TEMPLATE_ROOT);
        }
        
        Enumeration eKeys = b.getKeys();
        while (eKeys.hasMoreElements()) {
            Object keyObj = eKeys.nextElement();
            if (keyObj instanceof String) {
                String key = (String) keyObj;
                Velocity.setProperty(key, b.getString(key));
            }
        }      
        Velocity.init();
    }
View Full Code Here

        pluginTexturesCatalogUrl = temporaryTexturesCatalogUrl;
      } else if (urlUpdate != null) {
        pluginTexturesCatalogUrl = urlUpdate;
      }
     
      ResourceBundle resourceBundle = ResourceBundle.getBundle(PLUGIN_TEXTURES_CATALOG_FAMILY, Locale.getDefault(),
          new URLClassLoader(new URL [] {pluginTexturesCatalogUrl}));     
      readTextures(resourceBundle, pluginTexturesCatalogUrl, null, textureHomonymsCounter, identifiedTextures);
    } catch (MissingResourceException ex) {
      // Ignore malformed textures catalog
    } catch (IllegalArgumentException ex) {
View Full Code Here

TOP

Related Classes of java.util.ResourceBundle$MissingBundle

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.