1) Reintroduced PHPPerspectiveFactory (was lost with refactoring).
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / 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
16                         .getBundle(RESOURCE_BUNDLE);
17
18         private PHPUIMessages() {
19         }
20
21         public static String getString(String key) {
22                 try {
23                         return fgResourceBundle.getString(key);
24                 } catch (MissingResourceException e) {
25                         return '!' + key + '!';
26                 }
27         }
28
29         public static String getFormattedString(String key, String arg) {
30                 return getFormattedString(key, new String[] { arg });
31         }
32
33         public static String getFormattedString(String key, String[] args) {
34                 return MessageFormat.format(getString(key), args);
35         }
36
37 }