Mercurial > projects > dwt-addons
annotate dwtx/jface/text/JFaceTextMessages.d @ 174:c6d7b1ea700b
First sample running
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 11 Sep 2008 00:32:24 +0200 |
parents | 1a5b8f8129df |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.text.JFaceTextMessages; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
155
8442b6b2da2d
Fix import for ResourceBundle
Frank Benoit <benoit@tionex.de>
parents:
154
diff
changeset
|
17 import dwt.dwthelper.ResourceBundle; |
129 | 18 |
19 class JFaceTextMessages { | |
20 | |
159 | 21 // private static const String RESOURCE_BUNDLE= "dwtx.jface.text.JFaceTextMessages";//$NON-NLS-1$ |
22 | |
174 | 23 private static ResourceBundle fgResourceBundle_;//= ResourceBundle.getBundle(RESOURCE_BUNDLE); |
129 | 24 |
174 | 25 private static ResourceBundle fgResourceBundle(){ |
26 if( fgResourceBundle_ is null ){ | |
27 synchronized(JFaceTextMessages.classinfo ){ | |
28 if( fgResourceBundle_ is null ){ | |
29 fgResourceBundle_ = ResourceBundle.getBundle( | |
30 getImportData!("dwtx.jface.text.JFaceTextMessages.properties")); | |
31 } | |
32 } | |
33 } | |
34 return fgResourceBundle_; | |
159 | 35 } |
129 | 36 |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
37 private this() { |
129 | 38 } |
39 | |
40 public static String getString(String key) { | |
41 try { | |
42 return fgResourceBundle.getString(key); | |
43 } catch (MissingResourceException e) { | |
162 | 44 return "!" ~ key ~ "!";//$NON-NLS-2$ //$NON-NLS-1$ |
129 | 45 } |
46 } | |
47 } |