Mercurial > projects > dwt-addons
annotate dwtx/text/undo/UndoMessages.d @ 158:25f1f92fa3df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 26 Aug 2008 02:46:34 +0200 |
parents | 8442b6b2da2d |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 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.text.undo.UndoMessages; | |
14 | |
131 | 15 import dwtx.text.undo.DocumentUndoManager; // packageimport |
16 import dwtx.text.undo.DocumentUndoManagerRegistry; // packageimport | |
17 import dwtx.text.undo.DocumentUndoEvent; // packageimport | |
18 import dwtx.text.undo.IDocumentUndoListener; // packageimport | |
19 import dwtx.text.undo.IDocumentUndoManager; // packageimport | |
20 | |
21 | |
129 | 22 import dwt.dwthelper.utils; |
23 | |
155
8442b6b2da2d
Fix import for ResourceBundle
Frank Benoit <benoit@tionex.de>
parents:
154
diff
changeset
|
24 import dwt.dwthelper.ResourceBundle; |
158 | 25 import dwtx.dwtxhelper.MessageFormat; |
129 | 26 |
27 /** | |
28 * Helper class to get NLSed messages. | |
29 * | |
30 * @since 3.2 | |
31 */ | |
32 final class UndoMessages { | |
33 | |
150 | 34 // private static const String BUNDLE_NAME= "dwtx.text.undo.UndoMessages"; //$NON-NLS-1$ |
35 | |
36 private static const ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME); | |
129 | 37 |
150 | 38 static this() { |
39 RESOURCE_BUNDLE = ResourceBundle.getBundle( | |
40 getImportData!("dwtx.text.undo.UndoMessages.properties")); | |
41 } | |
129 | 42 |
130 | 43 private this() { |
129 | 44 } |
45 | |
46 public static String getString(String key) { | |
47 try { | |
48 return RESOURCE_BUNDLE.getString(key); | |
49 } catch (MissingResourceException e) { | |
150 | 50 return '!' ~ key ~ '!'; |
129 | 51 } |
52 } | |
53 | |
150 | 54 public static String getFormattedString(String key, Object[] args...) { |
129 | 55 return MessageFormat.format(getString(key), args); |
56 } | |
57 } |