KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > eclipse > enhydraWizard > NewEnhydraWizardMessages


1 package org.enhydra.kelp.eclipse.enhydraWizard;
2
3 import java.text.MessageFormat JavaDoc;
4 import java.util.MissingResourceException JavaDoc;
5 import java.util.ResourceBundle JavaDoc;
6
7 /**
8  * @author Tweety
9  *
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 JavaDoc RESOURCE_BUNDLE = "org.enhydra.kelp.eclipse.enhydraWizard.messages";
18     //private static final String RESOURCE_BUNDLE = NewEnhydraWizardMessages.class.getName();
19
private static ResourceBundle JavaDoc fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
20
21
22     /**
23      * Constructor for NewEnhydraWizardMessages.
24      */

25     public NewEnhydraWizardMessages() {
26         super();
27     }
28     
29
30     public static String JavaDoc getString(String JavaDoc key) {
31         try {
32             return fgResourceBundle.getString(key);
33         } catch (MissingResourceException JavaDoc e) {
34             return '!' + key + '!';
35         }
36     }
37     
38     /**
39      * Gets a string from the resource bundle and formats it with the argument
40      *
41      * @param key the string used to get the bundle value, must not be null
42      */

43     public static String JavaDoc getFormattedString(String JavaDoc key, Object JavaDoc arg) {
44         return MessageFormat.format(getString(key), new Object JavaDoc[] { arg });
45     }
46
47     /**
48      * Gets a string from the resource bundle and formats it with arguments
49      */

50     public static String JavaDoc getFormattedString(String JavaDoc key, Object JavaDoc[] args) {
51         return MessageFormat.format(getString(key), args);
52     }
53
54 }
55
Popular Tags