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
|
|
15 import dwtx.jface.text.source.ISharedTextColors; // packageimport
|
|
16 import dwtx.jface.text.source.ILineRange; // packageimport
|
|
17 import dwtx.jface.text.source.IAnnotationPresentation; // packageimport
|
|
18 import dwtx.jface.text.source.IVerticalRulerInfoExtension; // packageimport
|
|
19 import dwtx.jface.text.source.ICharacterPairMatcher; // packageimport
|
|
20 import dwtx.jface.text.source.TextInvocationContext; // packageimport
|
|
21 import dwtx.jface.text.source.LineChangeHover; // packageimport
|
|
22 import dwtx.jface.text.source.IChangeRulerColumn; // packageimport
|
|
23 import dwtx.jface.text.source.IAnnotationMap; // packageimport
|
|
24 import dwtx.jface.text.source.IAnnotationModelListenerExtension; // packageimport
|
|
25 import dwtx.jface.text.source.ISourceViewerExtension2; // packageimport
|
|
26 import dwtx.jface.text.source.IAnnotationHover; // packageimport
|
|
27 import dwtx.jface.text.source.ContentAssistantFacade; // packageimport
|
|
28 import dwtx.jface.text.source.IAnnotationAccess; // packageimport
|
|
29 import dwtx.jface.text.source.IVerticalRulerExtension; // packageimport
|
|
30 import dwtx.jface.text.source.IVerticalRulerColumn; // packageimport
|
|
31 import dwtx.jface.text.source.LineNumberRulerColumn; // packageimport
|
|
32 import dwtx.jface.text.source.MatchingCharacterPainter; // packageimport
|
|
33 import dwtx.jface.text.source.IAnnotationModelExtension; // packageimport
|
|
34 import dwtx.jface.text.source.ILineDifferExtension; // packageimport
|
|
35 import dwtx.jface.text.source.DefaultCharacterPairMatcher; // packageimport
|
|
36 import dwtx.jface.text.source.LineNumberChangeRulerColumn; // packageimport
|
|
37 import dwtx.jface.text.source.IAnnotationAccessExtension; // packageimport
|
|
38 import dwtx.jface.text.source.ISourceViewer; // packageimport
|
|
39 import dwtx.jface.text.source.AnnotationModel; // packageimport
|
|
40 import dwtx.jface.text.source.ILineDifferExtension2; // packageimport
|
|
41 import dwtx.jface.text.source.IAnnotationModelListener; // packageimport
|
|
42 import dwtx.jface.text.source.IVerticalRuler; // packageimport
|
|
43 import dwtx.jface.text.source.DefaultAnnotationHover; // packageimport
|
|
44 import dwtx.jface.text.source.SourceViewer; // packageimport
|
|
45 import dwtx.jface.text.source.SourceViewerConfiguration; // packageimport
|
|
46 import dwtx.jface.text.source.AnnotationBarHoverManager; // packageimport
|
|
47 import dwtx.jface.text.source.CompositeRuler; // packageimport
|
|
48 import dwtx.jface.text.source.ImageUtilities; // packageimport
|
|
49 import dwtx.jface.text.source.VisualAnnotationModel; // packageimport
|
|
50 import dwtx.jface.text.source.IAnnotationModel; // packageimport
|
|
51 import dwtx.jface.text.source.ISourceViewerExtension3; // packageimport
|
|
52 import dwtx.jface.text.source.ILineDiffInfo; // packageimport
|
|
53 import dwtx.jface.text.source.VerticalRulerEvent; // packageimport
|
|
54 import dwtx.jface.text.source.ChangeRulerColumn; // packageimport
|
|
55 import dwtx.jface.text.source.ILineDiffer; // packageimport
|
|
56 import dwtx.jface.text.source.AnnotationModelEvent; // packageimport
|
|
57 import dwtx.jface.text.source.AnnotationColumn; // packageimport
|
|
58 import dwtx.jface.text.source.AnnotationRulerColumn; // packageimport
|
|
59 import dwtx.jface.text.source.IAnnotationHoverExtension; // packageimport
|
|
60 import dwtx.jface.text.source.AbstractRulerColumn; // packageimport
|
|
61 import dwtx.jface.text.source.ISourceViewerExtension; // packageimport
|
|
62 import dwtx.jface.text.source.AnnotationMap; // packageimport
|
|
63 import dwtx.jface.text.source.IVerticalRulerInfo; // packageimport
|
|
64 import dwtx.jface.text.source.IAnnotationModelExtension2; // packageimport
|
|
65 import dwtx.jface.text.source.LineRange; // packageimport
|
|
66 import dwtx.jface.text.source.IAnnotationAccessExtension2; // packageimport
|
|
67 import dwtx.jface.text.source.VerticalRuler; // packageimport
|
|
68 import dwtx.jface.text.source.IOverviewRuler; // packageimport
|
|
69 import dwtx.jface.text.source.Annotation; // packageimport
|
|
70 import dwtx.jface.text.source.IVerticalRulerListener; // packageimport
|
|
71 import dwtx.jface.text.source.ISourceViewerExtension4; // packageimport
|
|
72 import dwtx.jface.text.source.AnnotationPainter; // packageimport
|
|
73 import dwtx.jface.text.source.IAnnotationHoverExtension2; // packageimport
|
|
74 import dwtx.jface.text.source.OverviewRuler; // packageimport
|
|
75 import dwtx.jface.text.source.OverviewRulerHoverManager; // packageimport
|
|
76
|
129
|
77 module dwtx.jface.text.source.JFaceTextMessages;
|
|
78
|
|
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. */
|
|
94 private static final String RESOURCE_BUNDLE= "dwtx.jface.text.JFaceTextMessages";//$NON-NLS-1$
|
|
95
|
|
96 /** The resource bundle. */
|
|
97 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
|
98
|
|
99 /**
|
|
100 * Prohibits the creation of accessor objects.
|
|
101 */
|
|
102 private JFaceTextMessages() {
|
|
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 }
|