1 11 package org.eclipse.ui.internal.presentations.r21; 12 13 import com.ibm.icu.text.MessageFormat; 14 import java.util.MissingResourceException ; 15 import java.util.ResourceBundle ; 16 17 20 public abstract class R21PresentationMessages { 21 22 private static final String RESOURCE_BUNDLE = "org.eclipse.ui.internal.presentations.r21.messages"; 24 private static ResourceBundle bundle = ResourceBundle 25 .getBundle(RESOURCE_BUNDLE); 26 27 36 public static String format(String key, Object [] args) { 37 return MessageFormat.format(getString(key), args); 38 } 39 40 48 public static String getString(String key) { 49 try { 50 return bundle.getString(key); 51 } catch (MissingResourceException e) { 52 return key; 53 } 54 } 55 56 66 public static String getString(String key, String def) { 67 try { 68 return bundle.getString(key); 69 } catch (MissingResourceException e) { 70 return def; 71 } 72 } 73 } 74 | Popular Tags |