1 11 12 package org.eclipse.jface.text.source; 13 14 import com.ibm.icu.text.MessageFormat; 15 import java.util.MissingResourceException ; 16 import java.util.ResourceBundle ; 17 18 23 class JFaceTextMessages { 24 25 26 private static final String RESOURCE_BUNDLE= "org.eclipse.jface.text.JFaceTextMessages"; 28 29 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 30 31 34 private JFaceTextMessages() { 35 } 36 37 43 public static String getString(String key) { 44 try { 45 return fgResourceBundle.getString(key); 46 } catch (MissingResourceException e) { 47 return "!" + key + "!"; } 49 } 50 51 59 public static String getFormattedString(String key, Object [] args) { 60 String format= null; 61 try { 62 format= fgResourceBundle.getString(key); 63 } catch (MissingResourceException e) { 64 return "!" + key + "!"; } 66 return MessageFormat.format(format, args); 67 } 68 } 69 | Popular Tags |