1 package org
.argeo
.eclipse
.ui
.specific
;
3 import org
.eclipse
.osgi
.util
.NLS
;
4 import org
.eclipse
.rwt
.RWT
;
6 /** NLS attached to a given thread */
7 public class ThreadNLS
<T
extends NLS
> extends InheritableThreadLocal
<T
> {
8 public final static String DEFAULT_BUNDLE_LOCATION
= "/properties/plugin";
10 private final String bundleLocation
;
12 private Class
<T
> type
;
13 private Boolean utf8
= false;
15 public ThreadNLS(String bundleLocation
, Class
<T
> type
, Boolean utf8
) {
16 this.bundleLocation
= bundleLocation
;
21 public ThreadNLS(Class
<T
> type
) {
22 this(DEFAULT_BUNDLE_LOCATION
, type
, false);
25 @SuppressWarnings("unchecked")
27 protected T
initialValue() {
29 return (T
) RWT
.NLS
.getUTF8Encoded(bundleLocation
, type
);
31 return (T
) RWT
.NLS
.getISO8859_1Encoded(bundleLocation
, type
);