org.ka2ddo.yaac.gui.util
Class EnumImageLoader

java.lang.Object
  extended by org.ka2ddo.yaac.gui.util.EnumImageLoader

public class EnumImageLoader
extends java.lang.Object

This class maintains a mapping of Enum value instances to ImageIcons, so enumerations can be identified in the UI by image picture.


Constructor Summary
EnumImageLoader()
           
 
Method Summary
static javax.swing.ImageIcon getImageIcon(java.lang.Enum e)
          Look up the ImageIcon for an enumeration.
static void registerEnum(java.lang.Class<? extends java.lang.Enum> clazz)
          Register an entire enum class using the specified prefix when building resource names for localized string lookups.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumImageLoader

public EnumImageLoader()
Method Detail

registerEnum

public static void registerEnum(java.lang.Class<? extends java.lang.Enum> clazz)
Register an entire enum class using the specified prefix when building resource names for localized string lookups.

Parameters:
clazz - Enum class whose elements should have images loaded
See Also:
Enum.name()

getImageIcon

public static javax.swing.ImageIcon getImageIcon(java.lang.Enum e)
Look up the ImageIcon for an enumeration.

Parameters:
e - Enum value to look up
Returns:
ImageIcon corresponding to this enum value, or null if no such icon