+ /** Returns the internationalized label for the given key */
+ public static String getMessage(String key) {
+ try {
+ return getDefault().messages.getString(key);
+ } catch (NullPointerException npe) {
+ log.warn(key + " not found.");
+ return key;
+ }
+ }
+
+ /**
+ * Gives access to the internationalization message bundle. Returns null in
+ * case the ClientUiPlugin is not started (for JUnit tests, by instance)
+ */
+ public static ResourceBundle getMessagesBundle() {
+ if (getDefault() != null)
+ // To avoid NPE
+ return getDefault().messages;
+ else
+ return null;
+ }