1 11 package org.eclipse.jface.text.templates.persistence; 12 13 import com.ibm.icu.text.MessageFormat; 14 import java.util.MissingResourceException ; 15 import java.util.ResourceBundle ; 16 17 20 class TemplatePersistenceMessages { 21 22 private static final String RESOURCE_BUNDLE= TemplatePersistenceMessages.class.getName(); 23 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 24 25 private TemplatePersistenceMessages() { 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 public static String getFormattedString(String key, Object [] args) { 41 return MessageFormat.format(getString(key), args); 42 } 43 } 44 | Popular Tags |