1 18 19 package org.apache.batik.ext.swing; 20 21 import java.util.Locale ; 22 import java.util.MissingResourceException ; 23 24 import org.apache.batik.i18n.LocalizableSupport; 25 import org.apache.batik.util.gui.resource.ResourceManager; 26 27 33 public class Resources { 34 35 38 protected Resources() { } 39 40 43 protected final static String RESOURCES = 44 "org.apache.batik.ext.swing.resources.Messages"; 45 46 49 protected static LocalizableSupport localizableSupport = 50 new LocalizableSupport(RESOURCES, Resources.class.getClassLoader()); 51 52 55 protected static ResourceManager resourceManager = 56 new ResourceManager(localizableSupport.getResourceBundle()); 57 58 61 public static void setLocale(Locale l) { 62 localizableSupport.setLocale(l); 63 resourceManager = new ResourceManager(localizableSupport.getResourceBundle()); 64 } 65 66 69 public static Locale getLocale() { 70 return localizableSupport.getLocale(); 71 } 72 73 77 public static String formatMessage(String key, Object [] args) 78 throws MissingResourceException { 79 return localizableSupport.formatMessage(key, args); 80 } 81 82 public static String getString(String key) 83 throws MissingResourceException { 84 return resourceManager.getString(key); 85 } 86 87 public static int getInteger(String key) 88 throws MissingResourceException { 89 return resourceManager.getInteger(key); 90 } 91 } 92 | Popular Tags |