1 11 package org.eclipse.jdt.internal.debug.ui.snippeteditor; 12 13 import com.ibm.icu.text.MessageFormat; 14 import java.util.MissingResourceException ; 15 import java.util.ResourceBundle ; 16 17 public class SnippetMessages { 18 19 private static final String RESOURCE_BUNDLE= "org.eclipse.jdt.internal.debug.ui.snippeteditor.SnippetMessages"; 21 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 22 23 private SnippetMessages() { 24 } 25 26 public static String getString(String key) { 27 try { 28 return fgResourceBundle.getString(key); 29 } catch (MissingResourceException e) { 30 return "!" + key + "!"; } 32 } 33 34 39 public static String getFormattedString(String key, Object arg) { 40 String format= null; 41 try { 42 format= fgResourceBundle.getString(key); 43 } catch (MissingResourceException e) { 44 return "!" + key + "!"; } 46 if (arg == null) 47 arg= ""; return MessageFormat.format(format, new Object [] { arg }); 49 } 50 51 static ResourceBundle getBundle() { 52 return fgResourceBundle; 53 } 54 } 55 | Popular Tags |