Package java.util

Examples of java.util.ResourceBundle$Control


   */
  private void readTexturesCatalog(final String texturesCatalogFamily,
                                   final UserPreferences preferences,
                                   Map<TexturesCategory, Map<CatalogTexture, Integer>> textureHomonymsCounter,
                                   List<String> identifiedTextures) {
    ResourceBundle resource;
    if (preferences != null) {
      // Adapt getLocalizedString to ResourceBundle
      resource = new ResourceBundle() {
          @Override
          protected Object handleGetObject(String key) {
            try {
              return preferences.getLocalizedString(texturesCatalogFamily, key);
            } catch (IllegalArgumentException ex) {
View Full Code Here


   *    <code>resourceBaseName</code>.
   */
  private void readActionPropertyValues(String resourceBaseName,
                                        String actionPrefix,
                                        ClassLoader pluginClassLoader) {
    ResourceBundle resource;
    if (pluginClassLoader != null) {
      resource = ResourceBundle.getBundle(resourceBaseName, Locale.getDefault(),
        pluginClassLoader);
    } else {
      resource = ResourceBundle.getBundle(resourceBaseName, Locale.getDefault());
View Full Code Here

        pluginFurnitureCatalogUrl = temporaryFurnitureCatalogUrl;
      } else if (urlUpdate != null) {
        pluginFurnitureCatalogUrl = urlUpdate;
      }
     
      ResourceBundle resourceBundle = ResourceBundle.getBundle(PLUGIN_FURNITURE_CATALOG_FAMILY, Locale.getDefault(),
          new URLClassLoader(new URL [] {pluginFurnitureCatalogUrl}));     
      readFurniture(resourceBundle, pluginFurnitureCatalogUrl, null, furnitureHomonymsCounter,
          identifiedFurniture);
    } catch (MissingResourceException ex) {
      // Ignore malformed furniture catalog
View Full Code Here

   */
  private void readFurnitureCatalog(final String furnitureCatalogFamily,
                                    final UserPreferences preferences,
                                    Map<FurnitureCategory, Map<CatalogPieceOfFurniture, Integer>> furnitureHomonymsCounter,
                                    List<String> identifiedFurniture) {
    ResourceBundle resource;
    if (preferences != null) {
      // Adapt getLocalizedString to ResourceBundle
      resource = new ResourceBundle() {
          @Override
          protected Object handleGetObject(String key) {
            try {
              return preferences.getLocalizedString(furnitureCatalogFamily, key);
            } catch (IllegalArgumentException ex) {
View Full Code Here

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

        }
       
        String version = "Unknown";
        try
        {
            ResourceBundle bundle = ResourceBundle.getBundle("org.jpox.JPOXVersion");
            try
            {
                version = bundle.getString("jpox.version");
            }
            catch (Exception e1)
            {
            }
        }
View Full Code Here

        }
       
        String vendor = "JPOX";
        try
        {
            ResourceBundle bundle = ResourceBundle.getBundle("org.jpox.JPOXVersion");
            try
            {
                vendor = bundle.getString("jpox.vendor");
            }
            catch (Exception e1)
            {
            }
        }
View Full Code Here

        action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
        action.setActionDefinitionId(IWorkbenchActionDefinitionIds.COPY);
        setGlobalAction(actionBars, ActionFactory.COPY.getId(), action);

        ResourceBundle bundle = BytecodeOutlinePlugin.getDefault()
            .getResourceBundle();

        setGlobalAction(
            actionBars, ActionFactory.FIND.getId(), new FindReplaceAction(
                bundle, NLS_PREFIX + "find_replace.", this)); //$NON-NLS-1$
View Full Code Here

   * @return resource bundle
   * @throws MissingResourceException if bundle cannot be found for any reason
   */
  public static ResourceBundle getBundle(String basename, Locale locale, ClassLoader cl, URL url) throws MissingResourceException {
   
    ResourceBundle resourceBundle = null;
   
    // ResourceBundle by default looks for loads of different ways of providing the
    // resource bundle. We do not want it to go to the server unless a different locale is
    // specified so must provide our own locating and loading
   
View Full Code Here

     */
    public String getMessage (
  Locale    locale,
  String    messageId
    ) {
  ResourceBundle  bundle;

  // cope with unsupported locale...
  if (locale == null)
      locale = Locale.getDefault ();

  try {
      bundle = ResourceBundle.getBundle (bundleName, locale);
      return bundle.getString (messageId);
  } catch (MissingResourceException e) {
      return packagePrefix (messageId);
  }
    }
View Full Code Here

TOP

Related Classes of java.util.ResourceBundle$Control

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.