Mercurial > projects > dwt-addons
annotate dwtx/jface/text/source/JFaceTextMessages.d @ 155:8442b6b2da2d
Fix import for ResourceBundle
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 25 Aug 2008 00:45:19 +0200 |
parents | 77b70cbb4c8d |
children | 25f1f92fa3df |
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 | |
131 | 14 |
151 | 15 module dwtx.jface.text.source.JFaceTextMessages; |
16 | |
131 | 17 import dwtx.jface.text.source.ISharedTextColors; // packageimport |
18 import dwtx.jface.text.source.ILineRange; // packageimport | |
19 import dwtx.jface.text.source.IAnnotationPresentation; // packageimport | |
20 import dwtx.jface.text.source.IVerticalRulerInfoExtension; // packageimport | |
21 import dwtx.jface.text.source.ICharacterPairMatcher; // packageimport | |
22 import dwtx.jface.text.source.TextInvocationContext; // packageimport | |
23 import dwtx.jface.text.source.LineChangeHover; // packageimport | |
24 import dwtx.jface.text.source.IChangeRulerColumn; // packageimport | |
25 import dwtx.jface.text.source.IAnnotationMap; // packageimport | |
26 import dwtx.jface.text.source.IAnnotationModelListenerExtension; // packageimport | |
27 import dwtx.jface.text.source.ISourceViewerExtension2; // packageimport | |
28 import dwtx.jface.text.source.IAnnotationHover; // packageimport | |
29 import dwtx.jface.text.source.ContentAssistantFacade; // packageimport | |
30 import dwtx.jface.text.source.IAnnotationAccess; // packageimport | |
31 import dwtx.jface.text.source.IVerticalRulerExtension; // packageimport | |
32 import dwtx.jface.text.source.IVerticalRulerColumn; // packageimport | |
33 import dwtx.jface.text.source.LineNumberRulerColumn; // packageimport | |
34 import dwtx.jface.text.source.MatchingCharacterPainter; // packageimport | |
35 import dwtx.jface.text.source.IAnnotationModelExtension; // packageimport | |
36 import dwtx.jface.text.source.ILineDifferExtension; // packageimport | |
37 import dwtx.jface.text.source.DefaultCharacterPairMatcher; // packageimport | |
38 import dwtx.jface.text.source.LineNumberChangeRulerColumn; // packageimport | |
39 import dwtx.jface.text.source.IAnnotationAccessExtension; // packageimport | |
40 import dwtx.jface.text.source.ISourceViewer; // packageimport | |
41 import dwtx.jface.text.source.AnnotationModel; // packageimport | |
42 import dwtx.jface.text.source.ILineDifferExtension2; // packageimport | |
43 import dwtx.jface.text.source.IAnnotationModelListener; // packageimport | |
44 import dwtx.jface.text.source.IVerticalRuler; // packageimport | |
45 import dwtx.jface.text.source.DefaultAnnotationHover; // packageimport | |
46 import dwtx.jface.text.source.SourceViewer; // packageimport | |
47 import dwtx.jface.text.source.SourceViewerConfiguration; // packageimport | |
48 import dwtx.jface.text.source.AnnotationBarHoverManager; // packageimport | |
49 import dwtx.jface.text.source.CompositeRuler; // packageimport | |
50 import dwtx.jface.text.source.ImageUtilities; // packageimport | |
51 import dwtx.jface.text.source.VisualAnnotationModel; // packageimport | |
52 import dwtx.jface.text.source.IAnnotationModel; // packageimport | |
53 import dwtx.jface.text.source.ISourceViewerExtension3; // packageimport | |
54 import dwtx.jface.text.source.ILineDiffInfo; // packageimport | |
55 import dwtx.jface.text.source.VerticalRulerEvent; // packageimport | |
56 import dwtx.jface.text.source.ChangeRulerColumn; // packageimport | |
57 import dwtx.jface.text.source.ILineDiffer; // packageimport | |
58 import dwtx.jface.text.source.AnnotationModelEvent; // packageimport | |
59 import dwtx.jface.text.source.AnnotationColumn; // packageimport | |
60 import dwtx.jface.text.source.AnnotationRulerColumn; // packageimport | |
61 import dwtx.jface.text.source.IAnnotationHoverExtension; // packageimport | |
62 import dwtx.jface.text.source.AbstractRulerColumn; // packageimport | |
63 import dwtx.jface.text.source.ISourceViewerExtension; // packageimport | |
64 import dwtx.jface.text.source.AnnotationMap; // packageimport | |
65 import dwtx.jface.text.source.IVerticalRulerInfo; // packageimport | |
66 import dwtx.jface.text.source.IAnnotationModelExtension2; // packageimport | |
67 import dwtx.jface.text.source.LineRange; // packageimport | |
68 import dwtx.jface.text.source.IAnnotationAccessExtension2; // packageimport | |
69 import dwtx.jface.text.source.VerticalRuler; // packageimport | |
70 import dwtx.jface.text.source.IOverviewRuler; // packageimport | |
71 import dwtx.jface.text.source.Annotation; // packageimport | |
72 import dwtx.jface.text.source.IVerticalRulerListener; // packageimport | |
73 import dwtx.jface.text.source.ISourceViewerExtension4; // packageimport | |
74 import dwtx.jface.text.source.AnnotationPainter; // packageimport | |
75 import dwtx.jface.text.source.IAnnotationHoverExtension2; // packageimport | |
76 import dwtx.jface.text.source.OverviewRuler; // packageimport | |
77 import dwtx.jface.text.source.OverviewRulerHoverManager; // packageimport | |
78 | |
129 | 79 import dwt.dwthelper.utils; |
80 | |
155
8442b6b2da2d
Fix import for ResourceBundle
Frank Benoit <benoit@tionex.de>
parents:
154
diff
changeset
|
81 import dwt.dwthelper.ResourceBundle; |
129 | 82 |
83 import com.ibm.icu.text.MessageFormat; | |
84 | |
85 /** | |
86 * Accessor for the <code>JFaceTextMessages.properties</code> file in | |
87 * package <code>dwtx.jface.text</code>. | |
88 * @since 2.0 | |
89 */ | |
90 class JFaceTextMessages { | |
91 | |
92 /** The resource bundle name. */ | |
147 | 93 private static const String RESOURCE_BUNDLE= "dwtx.jface.text.JFaceTextMessages";//$NON-NLS-1$ |
129 | 94 |
95 /** The resource bundle. */ | |
96 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); | |
97 | |
98 /** | |
99 * Prohibits the creation of accessor objects. | |
100 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
101 private this() { |
129 | 102 } |
103 | |
104 /** | |
105 * Returns the string found in the resource bundle under the given key or a place holder string. | |
106 * | |
107 * @param key the look up key | |
108 * @return the value found under the given key | |
109 */ | |
110 public static String getString(String key) { | |
111 try { | |
112 return fgResourceBundle.getString(key); | |
113 } catch (MissingResourceException e) { | |
114 return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ | |
115 } | |
116 } | |
117 | |
118 /** | |
119 * Gets a string from the resource bundle and formats it with the argument | |
120 * | |
121 * @param key the string used to get the bundle value, must not be null | |
122 * @param args arguments used when formatting the string | |
123 * @return the formatted string | |
124 * @since 3.0 | |
125 */ | |
126 public static String getFormattedString(String key, Object[] args) { | |
127 String format= null; | |
128 try { | |
129 format= fgResourceBundle.getString(key); | |
130 } catch (MissingResourceException e) { | |
131 return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ | |
132 } | |
133 return MessageFormat.format(format, args); | |
134 } | |
135 } |