Mercurial > projects > dwt-addons
annotate dwtx/jface/text/templates/JFaceTextTemplateMessages.d @ 133:7d818bd32d63
Fix ctors to this with gvim regexp
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 01:29:22 +0200 |
parents | c4fb132a086c |
children | 02cd5f1224d3 |
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.JFaceTextTemplateMessages; | |
14 | |
131 | 15 import dwtx.jface.text.templates.SimpleTemplateVariableResolver; // packageimport |
16 import dwtx.jface.text.templates.TemplateBuffer; // packageimport | |
17 import dwtx.jface.text.templates.TemplateContext; // packageimport | |
18 import dwtx.jface.text.templates.TemplateContextType; // packageimport | |
19 import dwtx.jface.text.templates.Template; // packageimport | |
20 import dwtx.jface.text.templates.TemplateVariable; // packageimport | |
21 import dwtx.jface.text.templates.PositionBasedCompletionProposal; // packageimport | |
22 import dwtx.jface.text.templates.TemplateException; // packageimport | |
23 import dwtx.jface.text.templates.TemplateTranslator; // packageimport | |
24 import dwtx.jface.text.templates.DocumentTemplateContext; // packageimport | |
25 import dwtx.jface.text.templates.GlobalTemplateVariables; // packageimport | |
26 import dwtx.jface.text.templates.InclusivePositionUpdater; // packageimport | |
27 import dwtx.jface.text.templates.TemplateProposal; // packageimport | |
28 import dwtx.jface.text.templates.ContextTypeRegistry; // packageimport | |
29 import dwtx.jface.text.templates.TemplateCompletionProcessor; // packageimport | |
30 import dwtx.jface.text.templates.TextTemplateMessages; // packageimport | |
31 import dwtx.jface.text.templates.TemplateVariableType; // packageimport | |
32 import dwtx.jface.text.templates.TemplateVariableResolver; // packageimport | |
33 | |
34 | |
129 | 35 import dwt.dwthelper.utils; |
36 | |
37 import java.util.MissingResourceException; | |
38 import java.util.ResourceBundle; | |
39 | |
40 import com.ibm.icu.text.MessageFormat; | |
41 | |
42 /** | |
43 * @since 3.0 | |
44 */ | |
45 class JFaceTextTemplateMessages { | |
46 | |
47 private static final String RESOURCE_BUNDLE= JFaceTextTemplateMessages.class.getName(); | |
48 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); | |
49 | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
50 private this() { |
129 | 51 } |
52 | |
53 public static String getString(String key) { | |
54 try { | |
55 return fgResourceBundle.getString(key); | |
56 } catch (MissingResourceException e) { | |
57 return '!' + key + '!'; | |
58 } | |
59 } | |
60 | |
61 public static String getFormattedString(String key, Object arg) { | |
62 return MessageFormat.format(getString(key), new Object[] { arg }); | |
63 } | |
64 | |
65 | |
66 public static String getFormattedString(String key, Object[] args) { | |
67 return MessageFormat.format(getString(key), args); | |
68 } | |
69 } |