net.sf.jaxodraw.plugin
Interface JaxoPluginDictionary


public interface JaxoPluginDictionary

A wrapper of JaxoDictionary for plugins.


Method Summary
 String label(String key)
          Translate 'key' as a label (typically, by appending ": " to the default translation).
 String message(String key, Object argument)
          Translates the given string into the current default language, interpolating a single argument.
 String message(String key, Object[] arguments)
          Translates the given string into the current default language, interpolating arguments.
 String message(String key, Object argument1, Object argument2)
          Translates the given string into the current default language, interpolating two arguments.
 String translate(String key)
          Translates the given string into the current default language.
 

Method Detail

label

String label(String key)
Translate 'key' as a label (typically, by appending ": " to the default translation).

Parameters:
key - The key to translate.
Returns:
The translation.

translate

String translate(String key)
Translates the given string into the current default language.

Parameters:
key - The key to translate.
Returns:
The translated string, or an empty string if key itself is empty.

message

String message(String key,
               Object argument)
Translates the given string into the current default language, interpolating a single argument. Equivalent to message(String,Object[]) with second argument new Object[] {argument}.

Parameters:
key - The key to translate.
argument - An object.
Returns:
The translated string.

message

String message(String key,
               Object argument1,
               Object argument2)
Translates the given string into the current default language, interpolating two arguments. Equivalent to message(String,Object[]) with second argument new Object[] {argument1, argument2}.

Parameters:
key - The key to translate.
argument1 - A first object.
argument2 - A second object.
Returns:
The translated string.

message

String message(String key,
               Object[] arguments)
Translates the given string into the current default language, interpolating arguments.

If arguments is not empty, the translation of key is used as a MessageFormat pattern, the arguments array is then used as the argument for Format.format(Object).

See the language.properties for notes on the parsing of MessageFormat patterns.

If however, arguments is empty, the key translation is not parsed as MessageFormat pattern (that way, the message methods can be used generically.)

By convention, the keys for MessageFormat pattern (and only them) contain percentage signs, followed by a number (starting from zero, as MessageFormat), to denote the occurrence of arguments (e.g. JaxoIO.read%0ReadFailed=File "{0}" could not be read.). Then:

Parameters:
key - The key to translate.
arguments - An array of objects (arguments for MessageFormat).
Returns:
The translated string.


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.