1 26 30 31 package org.omg.lifl.eclipse.plugin.project.OpenCCM.utils; 32 33 import java.text.MessageFormat ; 34 import java.util.MissingResourceException ; 35 import java.util.ResourceBundle ; 36 37 41 public class ProjectMessages { 42 43 private static final String RESOURCE_BUNDLE= ProjectMessages.class.getName(); 44 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 45 46 private ProjectMessages() { 47 } 48 49 public static String getString(String key) { 50 try { 51 return fgResourceBundle.getString(key); 52 } catch (MissingResourceException e) { 53 return '!' + key + '!'; 54 } 55 } 56 57 62 public static String getFormattedString(String key, Object arg) { 63 return MessageFormat.format(getString(key), new Object [] { arg }); 64 } 65 66 69 public static String getFormattedString(String key, Object [] args) { 70 return MessageFormat.format(getString(key), args); 71 } 72 73 } 74 | Popular Tags |