Mercurial > projects > dwt-addons
annotate dwtx/jface/text/templates/persistence/TemplatePersistenceMessages.d @ 154:77b70cbb4c8d
rem import for MissingResourceException
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 25 Aug 2008 00:42:29 +0200 |
parents | b3dec671d1f7 |
children | 8442b6b2da2d |
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 | |
22 import java.util.ResourceBundle; | |
23 | |
24 import com.ibm.icu.text.MessageFormat; | |
25 | |
26 /** | |
27 * @since 3.0 | |
28 */ | |
29 class TemplatePersistenceMessages { | |
30 | |
148 | 31 // private static const String RESOURCE_BUNDLE= TemplatePersistenceMessages.class.getName(); |
32 private static ResourceBundle fgResourceBundle;//= ResourceBundle.getBundle(RESOURCE_BUNDLE); | |
33 | |
34 static this() { | |
35 fgResourceBundle = ResourceBundle.getBundle( | |
36 getImportData!("dwtx.jface.text.templates.persistence.TemplatePersistenceMessages.properties")); | |
37 } | |
129 | 38 |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
39 private this() { |
129 | 40 } |
41 | |
42 public static String getString(String key) { | |
43 try { | |
44 return fgResourceBundle.getString(key); | |
45 } catch (MissingResourceException e) { | |
148 | 46 return '!' ~ key ~ '!'; |
129 | 47 } |
48 } | |
49 | |
148 | 50 public static String getFormattedString(String key, Object[] args...) { |
129 | 51 return MessageFormat.format(getString(key), args); |
52 } | |
53 } |