1 11 package org.eclipse.ui.wizards.newresource; 12 13 import java.text.MessageFormat ; 14 import java.util.MissingResourceException ; 15 import java.util.ResourceBundle ; 16 17 20 class ResourceMessages { 21 private static final String RESOURCE_BUNDLE= "org.eclipse.ui.wizards.newresource.messages"; private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); 23 24 private ResourceMessages(){ 25 } 27 35 public static String format(String key, Object [] args) { 36 return MessageFormat.format(getString(key),args); 37 } 38 46 public static String getString(String key) { 47 try { 48 return bundle.getString(key); 49 } catch (MissingResourceException e) { 50 return key; 51 } 52 } 53 } 54 | Popular Tags |