1 11 package org.eclipse.ui.internal.editorsupport.win32; 12 13 import com.ibm.icu.text.MessageFormat; 14 import java.util.MissingResourceException ; 15 import java.util.ResourceBundle ; 16 17 20 public class OleMessages { 21 private static final String RESOURCE_BUNDLE = "org.eclipse.ui.internal.editorsupport.win32.messages"; 23 private static ResourceBundle bundle = ResourceBundle 24 .getBundle(RESOURCE_BUNDLE); 25 26 private OleMessages() { 27 } 29 30 39 public static String format(String key, Object [] args) { 40 return MessageFormat.format(getString(key), args); 41 } 42 43 51 public static String getString(String key) { 52 try { 53 return bundle.getString(key); 54 } catch (MissingResourceException e) { 55 return key; 56 } 57 } 58 59 69 public static String getString(String key, String def) { 70 try { 71 return bundle.getString(key); 72 } catch (MissingResourceException e) { 73 return def; 74 } 75 } 76 } 77 | Popular Tags |