comparison org.eclipse.text/src/org/eclipse/text/undo/UndoMessages.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children 5feec68b4556
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
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 org.eclipse.text.undo.UndoMessages;
14
15 import org.eclipse.text.undo.DocumentUndoManager; // packageimport
16 import org.eclipse.text.undo.DocumentUndoManagerRegistry; // packageimport
17 import org.eclipse.text.undo.DocumentUndoEvent; // packageimport
18 import org.eclipse.text.undo.IDocumentUndoListener; // packageimport
19 import org.eclipse.text.undo.IDocumentUndoManager; // packageimport
20
21
22 import java.lang.all;
23
24 import java.util.ResourceBundle;
25 import java.util.MissingResourceException;
26 import java.text.MessageFormat;
27
28 /**
29 * Helper class to get NLSed messages.
30 *
31 * @since 3.2
32 */
33 final class UndoMessages {
34
35 // private static const String BUNDLE_NAME= "org.eclipse.text.undo.UndoMessages"; //$NON-NLS-1$
36
37 private static const ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME);
38
39 static this() {
40 RESOURCE_BUNDLE = ResourceBundle.getBundle(
41 getImportData!("org.eclipse.text.undo.UndoMessages.properties"));
42 }
43
44 private this() {
45 }
46
47 public static String getString(String key) {
48 try {
49 return RESOURCE_BUNDLE.getString(key);
50 } catch (MissingResourceException e) {
51 return '!' ~ key ~ '!';
52 }
53 }
54
55 public static String getFormattedString(String key, Object[] args...) {
56 return MessageFormat.format(getString(key), args);
57 }
58 }