net.sourceforge.jsxe.gui
Class Messages

java.lang.Object
  extended bynet.sourceforge.jsxe.gui.Messages

public class Messages
extends Object

Gets the messages for the current locale according to the JVM.

Since:
jsXe 0.4 pre1
Version:
$Id: Messages.java,v 1.7 2006/02/04 00:34:38 ian_lewis Exp $
Author:
Trish Hartnett (trishah136@member.fsf.org), Ian Lewis (IanLewis@member.fsf.org)

Constructor Summary
Messages()
           
 
Method Summary
static String getLanguage()
           
static String getMessage(String propertyName)
           
static String getMessage(String name, Object[] args)
          Returns the message with the specified name.
static void initializePropertiesObject(String language, String directory)
          Initializes the localized messages for jsXe.
static void loadPluginMessages(Properties pluginMessages)
          Loads the localized messages from installed plugins and merges them into the plugin messages.
static void setLanguage(String newLanguage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

getLanguage

public static String getLanguage()
Returns:
Returns the language.

setLanguage

public static void setLanguage(String newLanguage)
Parameters:
newLanguage - The language to set.

getMessage

public static String getMessage(String propertyName)
Returns:
Returns the value of a property from the propertiesObject.

getMessage

public static String getMessage(String name,
                                Object[] args)
Returns the message with the specified name.

The elements of the args array are substituted into the value of the property in place of strings of the form {n}, where n is an index in the array.

You can find out more about this feature by reading the documentation for the format method of the java.text.MessageFormat class.

Parameters:
name - The property
args - The positional parameters
Since:
jsXe 0.4 pre2

initializePropertiesObject

public static void initializePropertiesObject(String language,
                                              String directory)
Initializes the localized messages for jsXe. This method should only be called on jsXe startup.

Parameters:
language - The language for the propertiesObject.

loadPluginMessages

public static void loadPluginMessages(Properties pluginMessages)
Loads the localized messages from installed plugins and merges them into the plugin messages. This method should only be called on jsXe startup.