|
Eclipse Rich Ajax Platform Release 1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rwt.RWT.NLS
This utility class helps to provide a similar approach for compile safe
native language support than NLS
does.
We can not use the original approach though, due to the nature of
server side environments, that have to deal with different locales
per user session or even requests.
Usage:
public class FooMessages { private static final String BUNDLE_NAME = "foo.bar.messages"; public String MyMessage; public static FooMessages get() { return ( FootMessages )RWT.NLS.getISO8859_1Encoded( BUNDLE_NAME, FooMessages.class ); } }BUNDLE_NAME contains the name of a properties file (without file extension) that follows the conventions of standard
ResourceBundle
property
files. For each field (in the example 'MyMessage') there has to be a
key entry in the localization property file. Use the
FooMessages
like this in the application code:
Label label = ...; label.setText( FooMessages.get().MyMessage );
Constructor Summary | |
RWT.NLS()
|
Method Summary | |
static Object |
getISO8859_1Encoded(String bundleName,
Class clazz)
Returns a NLS object for the given bundle and type. |
static Object |
getUTF8Encoded(String bundleName,
Class clazz)
Returns a NLS object for the given bundle and type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RWT.NLS()
Method Detail |
public static Object getISO8859_1Encoded(String bundleName, Class clazz)
Properties
file
specification.
bundleName
- the bundle to load.clazz
- the class of the NLS object to load.public static Object getUTF8Encoded(String bundleName, Class clazz)
Properties
file specification and meant for a more convenient use.
bundleName
- the bundle to load.clazz
- the class of the NLS object to load.
|
Eclipse Rich Ajax Platform Release 1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2011. All rights reserved.