Examples of ResourceBundle


Examples of java.util.ResourceBundle

      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

Examples of java.util.ResourceBundle

 
  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

Examples of java.util.ResourceBundle

         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

Examples of java.util.ResourceBundle

         idBuf.append(n).append("_");
      idBuf.append(locale);
      String id = idBuf.toString();
      try
      {
         ResourceBundle res = cache_.get(id);
         if (res != null)
            return res;
         MapResourceBundle outputBundled = new MapResourceBundle(locale);
         for (int i = 0; i < name.length; i++)
         {
            ResourceBundle temp = getResourceBundle(name[i], locale, cl);
            if (temp != null)
            {
               outputBundled.merge(temp);
               continue;
            }
View Full Code Here

Examples of java.util.ResourceBundle

   public ResourceBundle getResourceBundle(String name)
   {
      ResourceBundleService service =
         (ResourceBundleService)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(
            ResourceBundleService.class);
      ResourceBundle res = service.getResourceBundle(name, locale_);
      return res;
   }
View Full Code Here

Examples of java.util.ResourceBundle

   public ResourceBundle getMergeResourceBundle(String[] names)
   {
      ResourceBundleService service =
         (ResourceBundleService)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(
            ResourceBundleService.class);
      ResourceBundle res = service.getResourceBundle(names, locale_);
      return res;
   }
View Full Code Here

Examples of java.util.ResourceBundle

  public void testLogWithResourceBundle() {
    SLF4JBridgeHandler.install();

    String resourceBundleName = "org.slf4j.bridge.testLogStrings";
    ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName);
    String resourceKey = "resource_key";
    String expectedMsg = bundle.getString(resourceKey);
    String msg = resourceKey;

    java.util.logging.Logger julResourceBundleLogger = java.util.logging.Logger
        .getLogger("yay", resourceBundleName);
View Full Code Here

Examples of java.util.ResourceBundle

  public void testLogWithResourceBundleWithParameters() {
    SLF4JBridgeHandler.install();

    String resourceBundleName = "org.slf4j.bridge.testLogStrings";
    ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName);

    java.util.logging.Logger julResourceBundleLogger = java.util.logging.Logger
        .getLogger("foo", resourceBundleName);

    String resourceKey1 = "resource_key_1";
    String expectedMsg1 = bundle.getString(resourceKey1);
    julResourceBundleLogger.info(resourceKey1); // 1st log

    String resourceKey2 = "resource_key_2";
    Object[] params2 = new Object[] { "foo", "bar" };
    String expectedMsg2 = MessageFormat.format(bundle.getString(resourceKey2),
        params2);
    julResourceBundleLogger.log(Level.INFO, resourceKey2, params2); // 2nd log

   
    String resourceKey3 = "invalidKey {0}";
View Full Code Here

Examples of java.util.ResourceBundle

  {

    defaultContext = new DefaultGuiContext(this, null);
    guiContext = defaultContext;

    final ResourceBundle resources = ResourceBundle.getBundle(SwingCommonModule.BUNDLE_NAME);
    cancelAction = new CancelAction(resources);
    confirmAction = new ConfirmAction(resources);

    formValidator = new ExportDialogValidator();
    setModal(true);
View Full Code Here

Examples of java.util.ResourceBundle

  public LibraryPanel(final List libraries)
  {

    setLayout(new BorderLayout());

    final ResourceBundle resources = ResourceBundle.getBundle(SwingPreviewModule.BUNDLE_NAME);

    final String[] names = new String[]{
        resources.getString("libraries-table.column.name"),
        resources.getString("libraries-table.column.version"),
        resources.getString("libraries-table.column.licence"),
        resources.getString("libraries-table.column.info")};
    final DefaultTableModel model = new DefaultTableModel(names, libraries.size());
    for (int i = 0; i < libraries.size(); i++)
    {
      final DependencyInformation depInfo = (DependencyInformation) libraries.get(i);
      model.setValueAt(depInfo.getName(), i, 0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.