Improved completion processor
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / PHPUIMessages.java
1 /*
2  * (c) Copyright IBM Corp. 2000, 2001.
3  * All Rights Reserved.
4  */
5 package net.sourceforge.phpdt.internal.ui;
6
7 import java.text.MessageFormat;
8 import java.util.MissingResourceException;
9 import java.util.ResourceBundle;
10
11 public class PHPUIMessages {
12
13         private static final String RESOURCE_BUNDLE = PHPUIMessages.class.getName();//$NON-NLS-1$
14
15         private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
16
17         private PHPUIMessages() {
18         }
19
20         public static String getString(String key) {
21                 try {
22                         return fgResourceBundle.getString(key);
23                 } catch (MissingResourceException e) {
24                         return '!' + key + '!';
25                 }
26         }
27         
28         public static String getFormattedString(String key, String arg) {
29                 return getFormattedString(key, new String[] { arg });
30         }
31         
32         public static String getFormattedString(String key, String[] args) {
33                 return MessageFormat.format(getString(key), args);      
34         }       
35         
36 }