Mercurial > projects > dwt-addons
annotate dwtx/jface/text/templates/persistence/TemplatePersistenceMessages.d @ 158:25f1f92fa3df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 26 Aug 2008 02:46:34 +0200 |
parents | 8442b6b2da2d |
children | c6d7b1ea700b |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2006 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.templates.persistence.TemplatePersistenceMessages; | |
14 | |
131 | 15 import dwtx.jface.text.templates.persistence.TemplatePersistenceData; // packageimport |
16 import dwtx.jface.text.templates.persistence.TemplateReaderWriter; // packageimport | |
17 import dwtx.jface.text.templates.persistence.TemplateStore; // packageimport | |
18 | |
19 | |
129 | 20 import dwt.dwthelper.utils; |
21 | |
155
8442b6b2da2d
Fix import for ResourceBundle
Frank Benoit <benoit@tionex.de>
parents:
154
diff
changeset
|
22 import dwt.dwthelper.ResourceBundle; |
158 | 23 import dwtx.dwtxhelper.MessageFormat; |
129 | 24 |
25 /** | |
26 * @since 3.0 | |
27 */ | |
28 class TemplatePersistenceMessages { | |
29 | |
158 | 30 // private static const String RESOURCE_BUNDLE= TemplatePersistenceMessages.classinfo.getName(); |
148 | 31 private static ResourceBundle fgResourceBundle;//= ResourceBundle.getBundle(RESOURCE_BUNDLE); |
32 | |
33 static this() { | |
34 fgResourceBundle = ResourceBundle.getBundle( | |
35 getImportData!("dwtx.jface.text.templates.persistence.TemplatePersistenceMessages.properties")); | |
36 } | |
129 | 37 |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
38 private this() { |
129 | 39 } |
40 | |
41 public static String getString(String key) { | |
42 try { | |
43 return fgResourceBundle.getString(key); | |
44 } catch (MissingResourceException e) { | |
148 | 45 return '!' ~ key ~ '!'; |
129 | 46 } |
47 } | |
48 | |
148 | 49 public static String getFormattedString(String key, Object[] args...) { |
129 | 50 return MessageFormat.format(getString(key), args); |
51 } | |
52 } |