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.text.edits.TextEditMessages;
|
|
14
|
131
|
15 import dwtx.text.edits.MultiTextEdit; // packageimport
|
|
16 import dwtx.text.edits.CopySourceEdit; // packageimport
|
|
17 import dwtx.text.edits.MoveSourceEdit; // packageimport
|
|
18 import dwtx.text.edits.CopyingRangeMarker; // packageimport
|
|
19 import dwtx.text.edits.ReplaceEdit; // packageimport
|
|
20 import dwtx.text.edits.EditDocument; // packageimport
|
|
21 import dwtx.text.edits.UndoCollector; // packageimport
|
|
22 import dwtx.text.edits.DeleteEdit; // packageimport
|
|
23 import dwtx.text.edits.MoveTargetEdit; // packageimport
|
|
24 import dwtx.text.edits.CopyTargetEdit; // packageimport
|
|
25 import dwtx.text.edits.TextEditCopier; // packageimport
|
|
26 import dwtx.text.edits.ISourceModifier; // packageimport
|
|
27 import dwtx.text.edits.TextEditProcessor; // packageimport
|
|
28 import dwtx.text.edits.MalformedTreeException; // packageimport
|
|
29 import dwtx.text.edits.TreeIterationInfo; // packageimport
|
|
30 import dwtx.text.edits.TextEditVisitor; // packageimport
|
|
31 import dwtx.text.edits.TextEditGroup; // packageimport
|
|
32 import dwtx.text.edits.TextEdit; // packageimport
|
|
33 import dwtx.text.edits.RangeMarker; // packageimport
|
|
34 import dwtx.text.edits.UndoEdit; // packageimport
|
|
35 import dwtx.text.edits.InsertEdit; // packageimport
|
|
36
|
|
37
|
129
|
38 import dwt.dwthelper.utils;
|
|
39
|
|
40 import java.util.MissingResourceException;
|
|
41 import java.util.ResourceBundle;
|
|
42
|
|
43 import com.ibm.icu.text.MessageFormat;
|
|
44
|
|
45 class TextEditMessages {
|
|
46
|
|
47 private static final String BUNDLE_NAME= "dwtx.text.edits.Messages"; //$NON-NLS-1$
|
|
48
|
|
49 private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
|
|
50
|
130
|
51 private this() {
|
129
|
52 }
|
|
53
|
|
54 public static String getString(String key) {
|
|
55 try {
|
|
56 return RESOURCE_BUNDLE.getString(key);
|
|
57 } catch (MissingResourceException e) {
|
|
58 return '!' + key + '!';
|
|
59 }
|
|
60 }
|
|
61
|
|
62 public static String getFormattedString(String key, Object arg) {
|
|
63 return getFormattedString(key, new Object[] { arg });
|
|
64 }
|
|
65
|
|
66 public static String getFormattedString(String key, Object[] args) {
|
|
67 return MessageFormat.format(getString(key), args);
|
|
68 }
|
|
69 }
|