Package java.util

Examples of java.util.ResourceBundle


     
      while (true) {
        //scan up packages until found
        String bundleName = packageName + ".i18n"; //$NON-NLS-1$
        try {
          ResourceBundle bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault(), clazz.getClassLoader());
          return new BundleUtil(packageName, bundleName, bundle);
        } catch (MissingResourceException e) {
          int index = packageName.lastIndexOf('.');
          if (index < 0) {
            throw e;
View Full Code Here


   * Constructor for TMLEditorContributor. Creates a new contributor in the
   * form of adding Content Format to the menu
   */
  public TMLEditorContributor() {
    super();
    ResourceBundle bundle = Plugin.getDefault().getResourceBundle();
    formatProposal = new RetargetTextEditorAction(bundle, "ContentFormatProposal.");
  }
View Full Code Here

  }

  @Override
  protected void createActions() {
    super.createActions();
    ResourceBundle resourceBundle = Plugin.getDefault().getResourceBundle();
    IAction action= new ContentAssistAction(resourceBundle, "ContentAssistProposal.", this);
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
   
    String actionId ="de.innovationgate.eclipse.wgadesigner.editors.tml.actions.ContentAssistProposal";
    setAction(actionId, action);
View Full Code Here

  @Override
  protected void createActions() {
    super.createActions();
   
    // action for quickfix
    ResourceBundle resourceBundle = Plugin.getDefault().getResourceBundle();
    DataRequestSelectAnnotationRulerAction rulerAction = new DataRequestSelectAnnotationRulerAction(resourceBundle, "PDESelectAnnotationRulerAction.", this, getVerticalRuler());
      setAction(ITextEditorActionConstants.RULER_CLICK, rulerAction);     
  }
View Full Code Here

    }
  }
 
  private static void populateFeatureDescriptor(Class<?> clazz, FeatureDescriptor prop){
    try{
      ResourceBundle bundle = ResourceBundle.getBundle(clazz.getName());
      prop.setDisplayName(
          bundle.getString(prop.getName()+".displayName"));
     
    }catch(MissingResourceException ex){
      try{
        ResourceBundle bundle = ResourceBundle.getBundle("beanLocales");
        prop.setDisplayName(
            bundle.getString(clazz.getName() + "." + prop.getName() + ".displayName"));
      }catch(MissingResourceException exp){
        try{
          ResourceBundle bundle = ResourceBundle.getBundle("beanLocales");
          prop.setDisplayName(
              bundle.getString(prop.getName()+".displayName"));
        }catch(MissingResourceException expe){}
      }
    }
    try{
      ResourceBundle bundle = ResourceBundle.getBundle(clazz.getName());
      prop.setShortDescription(
          bundle.getString(prop.getName()+".shortDescription"));
    }catch(MissingResourceException ex){
      try{
        ResourceBundle bundle = ResourceBundle.getBundle("beanLocales");
        prop.setShortDescription(
            bundle.getString(clazz.getName() + "." + prop.getName()+".shortDescription"));
      }catch(MissingResourceException exp) {
        try{
          ResourceBundle bundle = ResourceBundle.getBundle("beanLocales");
          prop.setDisplayName(
              bundle.getString(prop.getName()+".shortDescription"));
        }catch(MissingResourceException expe){}
      }
    }
  }
View Full Code Here

   }

   public void testResourceBundleServiceUpdate() throws Exception
   {
      //-------getResourceBundle have loaded from property file to database--------
      ResourceBundle res = service_.getResourceBundle(fileRes, Locale.ENGLISH);

      //    //------------create ressource bundle in database------------------
      createResourceBundle(databaseRes, PROPERTIES, Locale.ENGLISH);
      createResourceBundle(databaseRes, PROPERTIES_FR, Locale.FRANCE);

      res = service_.getResourceBundle(databaseRes, Locale.ENGLISH);
      assertTrue("Expect to find the ResourceBundle", res != null);

      res = service_.getResourceBundle(databaseRes, Locale.FRANCE);
      assertTrue("Expect to find the ResourceBundle", res != null);
      assertEquals("Expect French locale bundle", "fr", res.getString("language"));
      assertEquals("Expect French locale bundle", "property", res.getString("property"));
      //--------- Update a databseRes resource bundle in database ----------------
      createResourceBundle(databaseRes, PROPERTIES_FR_UPDATE, Locale.FRANCE);
      res = service_.getResourceBundle(databaseRes, Locale.FRANCE);
      assertEquals("Expect French locale bundle", "fr-property", res.getString("property"));

      //--------Update fileRes resource bundle in databse--------------
      String datas = "key1=fileSystem\nlanguage=french";
      createResourceBundle(fileRes, datas, Locale.FRANCE);
      res = service_.getResourceBundle(fileRes, Locale.FRANCE);
      assertTrue("Expect to find the ResourceBundle", res != null);
      assertTrue("Expect 'fileRes' is updated", res.getString("key1").equals("fileSystem"));
      assertEquals("Expect languge property is:", "french", res.getString("language"));

      //--------Update fileRes resource bundle in databse--------------
      datas = "key1=fileSystemUpdate\nlanguage=french";
      createResourceBundle(fileRes, datas, Locale.FRANCE);
      res = service_.getResourceBundle(fileRes, Locale.FRANCE);
      assertTrue("Expect to find the ResourceBundle", res != null);
      assertTrue("Expect 'fileRes' is updated", res.getString("key1").equals("fileSystemUpdate"));
      assertEquals("Expect languge property is:", "french", res.getString("language"));
   }
View Full Code Here

   }

   public void testResourceBundleServiceRemove() throws Exception
   {
      //-------getResourceBundle have loaded from property file to database--------
      ResourceBundle res = service_.getResourceBundle(fileRes, Locale.ENGLISH);

      //------------create ressource bundle in database------------------
      createResourceBundle(databaseRes, PROPERTIES, Locale.ENGLISH);
      createResourceBundle(databaseRes, PROPERTIES_FR, Locale.FRANCE);

      res = service_.getResourceBundle(databaseRes, Locale.ENGLISH);
      assertTrue("Expect to find the ResourceBundle", res != null);

      res = service_.getResourceBundle(databaseRes, Locale.FRANCE);
      assertTrue("Expect to find the ResourceBundle", res != null);
      assertEquals("Expect French locale bundle", "fr", res.getString("language"));
      assertEquals("Expect French locale bundle", "property", res.getString("property"));

      //    //-----------get all resource bundle-----------   
      Query q = new Query(null, null);
      List l = service_.findResourceDescriptions(q).getAll();
View Full Code Here

      Query q = new Query(null, null);
      List l = service_.findResourceDescriptions(q).getAll();

      //-------getResourceBundle have loaded from property file to database--------
      ResourceBundle res = service_.getResourceBundle(fileRes, Locale.ENGLISH);

      //------------create ressource bundle in database------------------
      createResourceBundle(databaseRes, PROPERTIES, Locale.ENGLISH);
      createResourceBundle(databaseRes, PROPERTIES_FR, Locale.FRANCE);

      res = service_.getResourceBundle(databaseRes, Locale.ENGLISH);
      assertTrue("Expect to find the ResourceBundle", res != null);

      res = service_.getResourceBundle(databaseRes, Locale.FRANCE);
      assertTrue("Expect to find the ResourceBundle", res != null);
      assertEquals("Expect French locale bundle", "fr", res.getString("language"));
      assertEquals("Expect French locale bundle", "property", res.getString("property"));

      //    //-----------get all resource bundle-----------   
      q = new Query(null, null);
      l = service_.findResourceDescriptions(q).getAll();
View Full Code Here

 
  private Properties properties = new Properties();
 
  private WSHumanTaskJMSProperties() {
    super();
    ResourceBundle bundle = ResourceBundle.getBundle("jmsht.conf");
    Enumeration<String> keys = bundle.getKeys();
    while (keys.hasMoreElements()) {
      String key = keys.nextElement();
      String value = bundle.getString(key);
      this.properties.setProperty(key, value);
    }
  }
View Full Code Here

         id = name + "_" + locale.getLanguage();
      }

      try
      {
         ResourceBundle rb = cache_.get(id);
         if (rb != null)
         {
            return rb;
         }
      }
      catch (Exception ex)
      {
      }

      try
      {
         ResourceBundle res = null;
         String rootId = name + "_" + localeService_.getDefaultLocaleConfig().getLanguage();
         ResourceBundle parent = getResourceBundleFromDb(rootId, null, locale);
         if (parent != null)
         {
            res = getResourceBundleFromDb(id, parent, locale);
            if (res == null)
               res = parent;
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.