01: package org.enhydra.kelp.eclipse.enhydraWizard;
02:
03: import java.text.MessageFormat;
04: import java.util.MissingResourceException;
05: import java.util.ResourceBundle;
06:
07: /**
08: * @author Tweety
09: *
10: * To change this generated comment edit the template variable "typecomment":
11: * Window>Preferences>Java>Templates.
12: * To enable and disable the creation of type comments go to
13: * Window>Preferences>Java>Code Generation.
14: */
15: public class NewEnhydraWizardMessages {
16:
17: private static final String RESOURCE_BUNDLE = "org.enhydra.kelp.eclipse.enhydraWizard.messages";
18: private static ResourceBundle fgResourceBundle = ResourceBundle
19: .getBundle(RESOURCE_BUNDLE);
20:
21: /**
22: * Constructor for NewEnhydraWizardMessages.
23: */
24: public NewEnhydraWizardMessages() {
25: }
26:
27: public static String getString(String key) {
28: try {
29: return fgResourceBundle.getString(key);
30: } catch (MissingResourceException e) {
31: return '!' + key + '!';
32: }
33: }
34:
35: /**
36: * Gets a string from the resource bundle and formats it with the argument
37: *
38: * @param key the string used to get the bundle value, must not be null
39: */
40: public static String getFormattedString(String key, Object arg) {
41: return MessageFormat.format(getString(key),
42: new Object[] { arg });
43: }
44:
45: /**
46: * Gets a string from the resource bundle and formats it with arguments
47: */
48: public static String getFormattedString(String key, Object[] args) {
49: return MessageFormat.format(getString(key), args);
50: }
51:
52: }
|