|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.yasl.arch.impl.resources.YASLResourceManagerImpl
Implements the YASLResourceManager interface.
Constructor Summary | |
YASLResourceManagerImpl()
Sets locale to default locale (whatever the JVM is using). |
|
YASLResourceManagerImpl(String defaultBundle)
|
Method Summary | |
String |
getDefaultBundle()
Returns the default bundle for the application's resource manager. |
Locale |
getLocale()
Returns the current Locale being used by this resource manager. |
String |
getString(String bundle,
String key)
Loads a String associated with the passed key from the named resource bundle. |
String |
getString(String bundle,
String key,
Locale locale)
Loads a String associated with the passed key from the named resource bundle based on the passed Locale. |
String |
getString(String bundle,
String key,
Locale locale,
ClassLoader classLoader)
Loads a String associated with the passed key from the named resource bundle based on the passed Locale. |
ImageIcon |
loadImageIcon(String iconName)
Loads an image as an ImageIcon. |
ImageIcon |
loadImageIcon(String iconName,
ClassLoader classLoader)
Loads an image as an ImageIcon. |
ImageIcon |
loadImageIcon(String bundle,
String key)
Loads an image as an ImageIcon after getting the fully qualified package name from a resource bundle. |
ImageIcon |
loadImageIcon(String bundle,
String key,
Locale locale)
Loads an image as an ImageIcon after getting the fully qualified package name from a resource bundle based on the passed Locale. |
void |
setLocale(Locale locale)
Sets the Locale to be used by this resource manager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public YASLResourceManagerImpl()
public YASLResourceManagerImpl(String defaultBundle)
Method Detail |
public String getDefaultBundle()
getDefaultBundle
in interface YASLResourceManager
public Locale getLocale()
getLocale
in interface YASLResourceManager
public String getString(String bundle, String key, Locale locale)
If the resource bundle or the key is not found, this method returns ???bundle??? or ???key???.
getString
in interface YASLResourceManager
bundle
- Stringkey
- Stringlocale
- Locale
public String getString(String bundle, String key, Locale locale, ClassLoader classLoader)
This method also takes a ClassLoader. If you are trying to load strings from a properties file in a jar that was not on the initial classpath, you must pass in the classloader for the jar file.
getString
in interface YASLResourceManager
bundle
- Stringkey
- Stringlocale
- LocaleclassLoader
- ClassLoader
public String getString(String bundle, String key)
If the resource bundle or the key is not found, this method returns ???bundle??? or ???key???.
getString
in interface YASLResourceManager
bundle
- Stringkey
- String
public ImageIcon loadImageIcon(String bundle, String key)
Will return null if the image cannot be loaded.
loadImageIcon
in interface YASLResourceManager
bundle
- Stringkey
- String
public ImageIcon loadImageIcon(String bundle, String key, Locale locale)
Will return null if the image cannot be loaded.
loadImageIcon
in interface YASLResourceManager
bundle
- Stringkey
- Stringlocale
- Locale
public ImageIcon loadImageIcon(String iconName)
Will return null when there are problems loading the image.
loadImageIcon
in interface YASLResourceManager
iconName
- String
public ImageIcon loadImageIcon(String iconName, ClassLoader classLoader)
This method also takes a ClassLoader. If you are trying to load images from a jar that was not on the initial classpath, you must pass in the classloader for the jar file that was loaded at runtime.
Will return null when there are problems loading the image.
loadImageIcon
in interface YASLResourceManager
iconName
- StringclassLoader
- ClassLoader
public void setLocale(Locale locale)
setLocale
in interface YASLResourceManager
locale
- Locale
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |