package ch.elexis.agenda.series.ui;
import java.beans.Beans;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
////////////////////////////////////////////////////////////////////////////
//
// Constructor
//
////////////////////////////////////////////////////////////////////////////
private Messages() {
// do not instantiate
}
////////////////////////////////////////////////////////////////////////////
//
// Bundle access
//
////////////////////////////////////////////////////////////////////////////
private static final String BUNDLE_NAME = "ch.elexis.agenda.series.ui.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = loadBundle();
private static ResourceBundle loadBundle() {
return ResourceBundle.getBundle(BUNDLE_NAME);
}
////////////////////////////////////////////////////////////////////////////
//
// Strings access
//
////////////////////////////////////////////////////////////////////////////
public static String getString(String key) {
try {
ResourceBundle bundle = Beans.isDesignTime() ? loadBundle() : RESOURCE_BUNDLE;
return bundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!";
}
}
}