ContextHelp now in new module net.sourceforge.phpeclipse.phphelp
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / preferences / PHPPreferencesMessages.java
1 package net.sourceforge.phpeclipse.preferences;
2
3 import java.text.MessageFormat;
4 import java.util.MissingResourceException;
5 import java.util.ResourceBundle;
6
7 public class PHPPreferencesMessages {
8
9
10   private static final String RESOURCE_BUNDLE= "net.sourceforge.phpeclipse.preferences.PHPPreferencesMessages";//$NON-NLS-1$
11
12         private static ResourceBundle resourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
13
14         private PHPPreferencesMessages() {
15         }
16
17         public static String getString(String key) {
18                 try {
19                         return resourceBundle.getString(key);
20                 } catch (MissingResourceException e) {
21                         return '!' + key + '!';
22                 }
23         }
24         
25         public static String getFormattedString(String key, String arg) {
26                 return getFormattedString(key, new String[] { arg });
27         }
28         
29         public static String getFormattedString(String key, String[] args) {
30                 return MessageFormat.format(getString(key), args);      
31         }
32         
33         public static ResourceBundle getResourceBundle() {
34                 return resourceBundle;
35         }
36 }