1 package net.sourceforge.phpdt.externaltools.preferences;
3 import java.text.MessageFormat;
4 import java.util.MissingResourceException;
5 import java.util.ResourceBundle;
7 public class PHPPreferencesMessages {
9 private static final String RESOURCE_BUNDLE= PHPPreferencesMessages.class.getName();
10 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
12 private PHPPreferencesMessages() {
15 public static String getString(String key) {
17 return fgResourceBundle.getString(key);
18 } catch (MissingResourceException e) {
19 return '!' + key + '!';
24 * Gets a string from the resource bundle and formats it with the argument
26 * @param key the string used to get the bundle value, must not be null
28 public static String getFormattedString(String key, Object arg) {
29 return MessageFormat.format(getString(key), new Object[] { arg });
34 * Gets a string from the resource bundle and formats it with arguments
36 public static String getFormattedString(String key, Object[] args) {
37 return MessageFormat.format(getString(key), args);