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
|
|
24 import java.util.ResourceBundle;
|
|
25
|
|
26 import com.ibm.icu.text.MessageFormat;
|
|
27
|
|
28 /**
|
|
29 * Helper class to get NLSed messages.
|
|
30 *
|
|
31 * @since 3.2
|
|
32 */
|
|
33 final class UndoMessages {
|
|
34
|
150
|
35 // private static const String BUNDLE_NAME= "dwtx.text.undo.UndoMessages"; //$NON-NLS-1$
|
|
36
|
|
37 private static const ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME);
|
129
|
38
|
150
|
39 static this() {
|
|
40 RESOURCE_BUNDLE = ResourceBundle.getBundle(
|
|
41 getImportData!("dwtx.text.undo.UndoMessages.properties"));
|
|
42 }
|
129
|
43
|
130
|
44 private this() {
|
129
|
45 }
|
|
46
|
|
47 public static String getString(String key) {
|
|
48 try {
|
|
49 return RESOURCE_BUNDLE.getString(key);
|
|
50 } catch (MissingResourceException e) {
|
150
|
51 return '!' ~ key ~ '!';
|
129
|
52 }
|
|
53 }
|
|
54
|
150
|
55 public static String getFormattedString(String key, Object[] args...) {
|
129
|
56 return MessageFormat.format(getString(key), args);
|
|
57 }
|
|
58 }
|