Mercurial > projects > dwt-addons
annotate dwtx/jface/text/hyperlink/HyperlinkMessages.d @ 140:26688fec6d23
Following dsss compile errors
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 03:23:46 +0200 |
parents | 7d818bd32d63 |
children | 000f9136b8f7 |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2008 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.hyperlink.HyperlinkMessages; | |
14 | |
131 | 15 import dwtx.jface.text.hyperlink.IHyperlinkPresenterExtension; // packageimport |
16 import dwtx.jface.text.hyperlink.MultipleHyperlinkPresenter; // packageimport | |
17 import dwtx.jface.text.hyperlink.HyperlinkManager; // packageimport | |
18 import dwtx.jface.text.hyperlink.URLHyperlink; // packageimport | |
19 import dwtx.jface.text.hyperlink.IHyperlinkDetectorExtension2; // packageimport | |
20 import dwtx.jface.text.hyperlink.IHyperlinkDetector; // packageimport | |
21 import dwtx.jface.text.hyperlink.IHyperlinkPresenter; // packageimport | |
22 import dwtx.jface.text.hyperlink.URLHyperlinkDetector; // packageimport | |
23 import dwtx.jface.text.hyperlink.DefaultHyperlinkPresenter; // packageimport | |
24 import dwtx.jface.text.hyperlink.AbstractHyperlinkDetector; // packageimport | |
25 import dwtx.jface.text.hyperlink.IHyperlinkDetectorExtension; // packageimport | |
26 import dwtx.jface.text.hyperlink.IHyperlink; // packageimport | |
27 | |
28 | |
129 | 29 import dwt.dwthelper.utils; |
30 | |
31 import java.util.MissingResourceException; | |
32 import java.util.ResourceBundle; | |
33 | |
34 | |
35 /** | |
36 * Helper class to get NLSed messages. | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
37 * |
129 | 38 * @since 3.4 |
39 */ | |
40 class HyperlinkMessages { | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
41 // private static final String BUNDLE_NAME= HyperlinkMessages.class.getName(); |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
42 |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
43 private static final ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME); |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
44 |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
45 static this() { |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
46 RESOURCE_BUNDLE = ResourceBundle.getBundle( |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
47 getImportData!("dwtx.jface.text.HyperlinkMessages.properties")); |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
48 } |
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
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 /** | |
54 * Gets a string from the resource bundle. | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
55 * |
129 | 56 * @param key the string used to get the bundle value, must not be |
57 * <code>null</code> | |
58 * @return the string from the resource bundle | |
59 */ | |
60 public static String getString(String key) { | |
61 try { | |
62 return RESOURCE_BUNDLE.getString(key); | |
63 } catch (MissingResourceException e) { | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
64 return '!' ~ key ~ '!'; |
129 | 65 } |
66 } | |
67 } |