1 11 package org.eclipse.jface.text.templates; 12 13 import com.ibm.icu.text.MessageFormat; 14 import java.util.MissingResourceException ; 15 import java.util.ResourceBundle ; 16 17 20 class TextTemplateMessages { 21 22 private static final String RESOURCE_BUNDLE= TextTemplateMessages.class.getName(); 23 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 24 25 private TextTemplateMessages() { 26 } 27 28 public static String getString(String key) { 29 try { 30 return fgResourceBundle.getString(key); 31 } catch (MissingResourceException e) { 32 return '!' + key + '!'; 33 } 34 } 35 36 public static String getFormattedString(String key, Object arg) { 37 return MessageFormat.format(getString(key), new Object [] { arg }); 38 } 39 40 41 public static String getFormattedString(String key, Object [] args) { 42 return MessageFormat.format(getString(key), args); 43 } 44 } 45 | Popular Tags |