1 package org.eclipse.emf.examples.jet.article2.ui; 2 3 4 import java.text.MessageFormat ; 5 import java.util.MissingResourceException ; 6 import java.util.ResourceBundle ; 7 8 import org.eclipse.core.runtime.Platform; 9 10 import org.eclipse.emf.examples.jet.article2.TypesafeEnumPlugin; 11 12 13 19 public class WizardMessages 20 { 21 private static final ResourceBundle RESOURCE_BUNDLE = Platform.getResourceBundle(TypesafeEnumPlugin.getDefault().getBundle()); 22 23 private WizardMessages() 24 { 25 } 26 27 public static String getString(String key) 28 { 29 try 30 { 31 return RESOURCE_BUNDLE.getString(key); 32 } 33 catch (MissingResourceException e) 34 { 35 return '!' + key + '!'; 36 } 37 } 38 39 45 public static String getFormattedString(String key, Object arg) 46 { 47 return MessageFormat.format(getString(key), new Object []{ arg }); 48 } 49 50 53 public static String getFormattedString(String key, Object [] args) 54 { 55 return MessageFormat.format(getString(key), args); 56 } 57 58 } | Popular Tags |