Mercurial > projects > dwt-addons
annotate dwtx/jface/text/source/JFaceTextMessages.d @ 151:eb21d3dfc767
fix module statement
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 23:55:45 +0200 |
parents | 000f9136b8f7 |
children | 77b70cbb4c8d |
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 | |
81 import java.util.MissingResourceException; | |
82 import java.util.ResourceBundle; | |
83 | |
84 import com.ibm.icu.text.MessageFormat; | |
85 | |
86 /** | |
87 * Accessor for the <code>JFaceTextMessages.properties</code> file in | |
88 * package <code>dwtx.jface.text</code>. | |
89 * @since 2.0 | |
90 */ | |
91 class JFaceTextMessages { | |
92 | |
93 /** The resource bundle name. */ | |
147 | 94 private static const String RESOURCE_BUNDLE= "dwtx.jface.text.JFaceTextMessages";//$NON-NLS-1$ |
129 | 95 |
96 /** The resource bundle. */ | |
97 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); | |
98 | |
99 /** | |
100 * Prohibits the creation of accessor objects. | |
101 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
102 private this() { |
129 | 103 } |
104 | |
105 /** | |
106 * Returns the string found in the resource bundle under the given key or a place holder string. | |
107 * | |
108 * @param key the look up key | |
109 * @return the value found under the given key | |
110 */ | |
111 public static String getString(String key) { | |
112 try { | |
113 return fgResourceBundle.getString(key); | |
114 } catch (MissingResourceException e) { | |
115 return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ | |
116 } | |
117 } | |
118 | |
119 /** | |
120 * Gets a string from the resource bundle and formats it with the argument | |
121 * | |
122 * @param key the string used to get the bundle value, must not be null | |
123 * @param args arguments used when formatting the string | |
124 * @return the formatted string | |
125 * @since 3.0 | |
126 */ | |
127 public static String getFormattedString(String key, Object[] args) { | |
128 String format= null; | |
129 try { | |
130 format= fgResourceBundle.getString(key); | |
131 } catch (MissingResourceException e) { | |
132 return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ | |
133 } | |
134 return MessageFormat.format(format, args); | |
135 } | |
136 } |