Examples of ResourceBundle


Examples of br.gov.frameworkdemoiselle.util.ResourceBundle

   
    return super.getColumnHeader(propertyId);
  }
 
  private static String resolveProperties(final String message) {
    ResourceBundle bundle = Beans.getReference(ResourceBundle.class);
    String result = message;
    if (Strings.isResourceBundleKeyFormat(message)) {
      result = bundle.getString(Strings.removeBraces(message));
    }
    return result;
  }
View Full Code Here

Examples of com.google.sitebricks.i18n.ResourceBundle

    @Override
    public void render(Object bound, Respond respond) {
        if (!respond.getErrors().isEmpty()) {
            Localizer.Localization localization = null;
            ResourceBundle resourceBundle = bound.getClass().getAnnotation(ResourceBundle.class);
            if (resourceBundle != null) {
                Map<Locale, Localizer.Localization> localizerMap = localizationsMap.get(resourceBundle.value());
                if (localizerMap != null) {
                    localization = localizerMap.get(locale);
                }
                if (localization == null) {
                    localization = Localizer.defaultLocalizationFor(resourceBundle.value());
                }
            }
            respond.write("<div class=\"errors\">");
            respond.write("<ul>");
            for (String errorKey : respond.getErrors()) {
View Full Code Here

Examples of de.esoco.j2me.resource.ResourceBundle

      String sPassword = (String) ((Dialog) rInputDialog).getResult();

      if (sPassword == null)
      {
        // Password NULL means that the input verification failed
        ResourceBundle rRsrc  = ResourceBundle.getCurrent();
        String       sTitle = rRsrc.getString("MtPassErr");
        String       sText  = rRsrc.getString("MsPassComp");

        MessageScreen.showAlert(sTitle, sText, AlertType.ERROR);

        return;
      }
View Full Code Here

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

Examples of java.util.ResourceBundle

   * 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

Examples of java.util.ResourceBundle

  }

  @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

Examples of java.util.ResourceBundle

  @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

Examples of java.util.ResourceBundle

    }
  }
 
  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

Examples of java.util.ResourceBundle

   }

   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

Examples of java.util.ResourceBundle

   }

   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
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.