Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.pentaho.reporting.ui.datasources.scriptable;
  
  import java.util.Locale;
  import javax.swing.Icon;
  
  import  org.apache.commons.logging.Log;
  import  org.apache.commons.logging.LogFactory;
 import  org.pentaho.reporting.libraries.base.util.ObjectUtilities;
 import  org.pentaho.reporting.libraries.base.util.ResourceBundleSupport;

Todo: Document me!

Date: 28.10.2009 Time: 16:14:48

Author(s):
Thomas Morgner.
 
 public class Messages
 {
   private static final Log logger = LogFactory.getLog(Messages.class);
   private static ResourceBundleSupport bundle =
       new ResourceBundleSupport(Locale.getDefault(), "org.pentaho.reporting.ui.datasources.scriptable.messages",
           ObjectUtilities.getClassLoader(Messages.class));
 
   private Messages()
   {
   }

  
Gets a string for the given key from this resource bundle or one of its parents. If the key is a link, the link is resolved and the referenced string is returned instead. If the given key cannot be resolved, no exception will be thrown and a generic placeholder is used instead.

Parameters:
key the key for the desired string
Returns:
the string for the given key
Throws:
NullPointerException if key is null
java.util.MissingResourceException if no object for the given key can be found
 
   public static String getString(final String key)
   {
     try
     {
       return .getString(key);
     }
     catch (MissingResourceException e)
     {
       .warn("Missing localization: " + keye);
       return '!' + key + '!';
     }
   }

  
Formats the message stored in the resource bundle (using a MessageFormat).

Parameters:
key the resourcebundle key
param1 the parameter for the message
Returns:
the formated string
 
   public static String getString(final String keyfinal String param1)
   {
     try
     {
       return .formatMessage(keyparam1);
     }
     catch (MissingResourceException e)
     {
       .warn("Missing localization: " + keye);
       return '!' + key + '!';
     }
   }

  
Formats the message stored in the resource bundle (using a MessageFormat).

Parameters:
key the resourcebundle key
param1 the parameter for the message
param2 the parameter for the message
Returns:
the formated string
 
   public static String getString(final String keyfinal String param1final String param2)
   {
     try
     {
       return .formatMessage(keyparam1param2);
     }
     catch (MissingResourceException e)
     {
       .warn("Missing localization: " + keye);
       return '!' + key + '!';
     }
   }

  
Formats the message stored in the resource bundle (using a MessageFormat).

Parameters:
key the resourcebundle key
param1 the parameter for the message
param2 the parameter for the message
param3 the parameter for the message
Returns:
the formated string
  public static String getString(final String keyfinal String param1final String param2final String param3)
  {
    try
    {
      return .formatMessage(keynew Object[]{param1param2param3});
    }
    catch (MissingResourceException e)
    {
      .warn("Missing localization: " + keye);
      return '!' + key + '!';
    }
  }

  
Formats the message stored in the resource bundle (using a MessageFormat).

Parameters:
key the resourcebundle key
param1 the parameter for the message
param2 the parameter for the message
param3 the parameter for the message
param4 the parameter for the message
Returns:
the formated string
  public static String getString(final String key,
                                 final String param1,
                                 final String param2,
                                 final String param3,
                                 final String param4)
  {
    try
    {
      return .formatMessage(keynew Object[]{param1param2param3param4});
    }
    catch (MissingResourceException e)
    {
      .warn("Missing localization: " + keye);
      return '!' + key + '!';
    }
  }


  
Formats the message stored in the resource bundle (using a MessageFormat).

Parameters:
key the resourcebundle key
param1 the parameter for the message
param2 the parameter for the message
param3 the parameter for the message
param4 the parameter for the message
param5 the parameter for the message
Returns:
the formated string
  public static String getString(final String key,
                                 final String param1,
                                 final String param2,
                                 final String param3,
                                 final String param4,
                                 final String param5)
  {
    try
    {
      return .formatMessage(keynew Object[]{param1param2param3param4param5});
    }
    catch (MissingResourceException e)
    {
      .warn("Missing localization: " + keye);
      return '!' + key + '!';
    }
  }
  public static Icon getIcon(final String keyfinal boolean large)
  {
    return .getIcon(keylarge);
  }
  public static Icon getIcon(final String key)
  {
    return .getIcon(key);
  }
  public static Integer getMnemonic(final String key)
  {
    return .getMnemonic(key);
  }
  public static Integer getOptionalMnemonic(final String key)
  {
    return .getOptionalMnemonic(key);
  }
  public static KeyStroke getKeyStroke(final String key)
  {
    return .getKeyStroke(key);
  }
  public static KeyStroke getOptionalKeyStroke(final String key)
  {
    return .getOptionalKeyStroke(key);
  }
  public static KeyStroke getKeyStroke(final String keyfinal int mask)
  {
    return .getKeyStroke(keymask);
  }
  public static KeyStroke getOptionalKeyStroke(final String keyfinal int mask)
  {
    return .getOptionalKeyStroke(keymask);
  }
New to GrepCode? Check out our FAQ X