Package org.apache.wicket

Examples of org.apache.wicket.Localizer


   */
  public Localizer getLocalizer()
  {
    if (localizer == null)
    {
      localizer = new Localizer();
    }
    return localizer;
  }
View Full Code Here


   */
  public Localizer getLocalizer()
  {
    if (localizer == null)
    {
      localizer = new Localizer();
    }
    return localizer;
  }
View Full Code Here

   * @see org.apache.wicket.validation.IErrorMessageSource#getMessage(java.lang.String, java.util.Map)
   */
        @Override
  public final String getMessage(String key, Map<String, Object> vars)
  {
    Localizer localizer = Application.get().getResourceSettings().getLocalizer();
    // Note: It is important that the default value of "" is provided
    // to getString() not to throw a MissingResourceException or to
    // return a default string like "[Warning: String ..."
    String message = localizer.getString(key, getComponent(), "");
    if (Strings.isEmpty(message))
                {     
      return null;
                }
    else
View Full Code Here

      if (Strings.isEmpty(prefix))
      {
        prefix = "";
      }

      final Localizer localizer = formComponent.getLocalizer();

      String resource = prefix + getId() + "." + key;

      // First use the parent for resolving so that
      // form1.textfield1.Required can be used.

      // Note: It is important that the default value of "" is provided
      // to getString() not to throw a MissingResourceException or to
      // return a default string like "[Warning: String ..."
      String message = localizer.getString(resource, formComponent.getParent(), "");

      // If not found, than ...
      if (Strings.isEmpty(message))
      {
        // Try a variation of the resource key

        resource = prefix + key;

        message = localizer.getString(resource, formComponent.getParent(), "");
      }

      if (Strings.isEmpty(message))
      {
        // If still empty then use default

        resource = prefix + getId() + "." + key;

        // Note: It is important that the default value of "" is
        // provided
        // to getString() not to throw a MissingResourceException or to
        // return a default string like "[Warning: String ..."
        message = localizer.getString(resource, formComponent, "");

        // If not found, than ...
        if (Strings.isEmpty(message))
        {
          // Try a variation of the resource key

          resource = prefix + key;

          message = localizer.getString(resource, formComponent, "");
        }
      }

      // convert empty string to null in case our default value of "" was
      // returned from localizer
View Full Code Here

   */
  public Localizer getLocalizer()
  {
    if (localizer == null)
    {
      localizer = new Localizer();
    }
    return localizer;
  }
View Full Code Here

      // Use the following log4j config for detailed logging on the property resolution
      // process
      // log4j.logger.org.apache.wicket.resource.loader=DEBUG
      // log4j.logger.org.apache.wicket.Localizer=DEBUG

      final Localizer localizer = formComponent.getLocalizer();

      // retrieve prefix that will be used to construct message keys
      String prefix = formComponent.getValidatorKeyPrefix();
      String message = null;
View Full Code Here

      if (Strings.isEmpty(prefix))
      {
        prefix = "";
      }

      final Localizer localizer = formComponent.getLocalizer();

      String resource = prefix + getId() + "." + key;
     
      // First use the parent for resolving so that form1.textfield1.RequiredValidator can be used.
     
      // Note: It is important that the default value of "" is provided
      // to getString() not to throw a MissingResourceException or to
      // return a default string like "[Warning: String ..."
      String message = localizer.getString(resource, formComponent.getParent(), "");

      // If not found, than ...
      if (Strings.isEmpty(message))
      {
        // Try a variation of the resource key

        resource = prefix + key;

        message = localizer.getString(resource, formComponent.getParent(), "");
      }

      if (Strings.isEmpty(message))
      {
        // If still empty then use default
       
        resource = prefix + getId() + "." + key;
 
        // Note: It is important that the default value of "" is provided
        // to getString() not to throw a MissingResourceException or to
        // return a default string like "[Warning: String ..."
        message = localizer.getString(resource, formComponent, "");
 
        // If not found, than ...
        if (Strings.isEmpty(message))
        {
          // Try a variation of the resource key
 
          resource = prefix + key;
 
          message = localizer.getString(resource, formComponent, "");
        }
      }

      // convert empty string to null in case our default value of "" was
      // returned from localizer
View Full Code Here

   */
  public Localizer getLocalizer()
  {
    if (localizer == null)
    {
      this.localizer = new Localizer();
    }
    return localizer;
  }
View Full Code Here

  @Override
  public Localizer getLocalizer()
  {
    if (localizer == null)
    {
      localizer = new Localizer();
    }
    return localizer;
  }
View Full Code Here

      if (Strings.isEmpty(prefix))
      {
        prefix = "";
      }

      final Localizer localizer = formComponent.getLocalizer();

      String resource = prefix + getId() + "." + key;

      // First use the parent for resolving so that
      // form1.textfield1.Required can be used.
View Full Code Here

TOP

Related Classes of org.apache.wicket.Localizer

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.