1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.actions.lang;
13
14 import java.util.MissingResourceException;
15 import java.util.ResourceBundle;
16 import sk.uniba.euromath.tools.LangTools;
17
18 /***
19 * Messages class for package sk.uniba.euromath.editor.actions.
20 * @author Tomáš Studva
21 * 24.1.2006
22 */
23 public class Messages {
24 /***
25 * Name of bundle with messages.
26 */
27 private static final String BUNDLE_NAME = "sk.uniba.euromath.editor.actions.lang.messages";
28
29 /***
30 * Resource bundle.
31 */
32 private static final ResourceBundle RESOURCE_BUNDLE = LangTools.newBundle(
33 BUNDLE_NAME, Messages.class);
34
35 /***
36 * Hides constructor.
37 */
38 private Messages() {
39 super();
40 }
41
42 /***
43 * Message retreiving method.
44 * @param key identifier of messages
45 * @return message
46 */
47 public static String getString(String key) {
48 try {
49 return RESOURCE_BUNDLE.getString(key);
50 } catch (MissingResourceException e) {
51 return '!' + key + '!';
52 }
53 }
54 }