com.alee.utils.swing
Class EnumLazyIconProvider

java.lang.Object
  extended by com.alee.utils.swing.EnumLazyIconProvider

public class EnumLazyIconProvider
extends java.lang.Object

Special class for simple and lazy enum icons retrieval.

Author:
Mikle Garin

Constructor Summary
EnumLazyIconProvider()
           
 
Method Summary
static
<E extends java.lang.Enum<E>>
javax.swing.ImageIcon
getIcon(E enumeration, java.lang.String folder)
          Returns cached or just loaded enum icon.
static
<E extends java.lang.Enum<E>>
javax.swing.ImageIcon
getIcon(E enumeration, java.lang.String state, java.lang.String folder)
          Returns cached or just loaded enum icon for the specified state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumLazyIconProvider

public EnumLazyIconProvider()
Method Detail

getIcon

public static <E extends java.lang.Enum<E>> javax.swing.ImageIcon getIcon(E enumeration,
                                                                          java.lang.String folder)
Returns cached or just loaded enum icon.

Type Parameters:
E - enumeration type
Parameters:
enumeration - enumeration constant for which icon should be loaded
folder - enumeration icons folder
Returns:
cached or just loaded enum icon

getIcon

public static <E extends java.lang.Enum<E>> javax.swing.ImageIcon getIcon(E enumeration,
                                                                          java.lang.String state,
                                                                          java.lang.String folder)
Returns cached or just loaded enum icon for the specified state. State string will be used to determine icon name automatically.

Type Parameters:
E - enumeration type
Parameters:
enumeration - enumeration constant for which icon should be loaded
state - enumeration icon state
folder - enumeration icons folder
Returns:
cached or just loaded enum icon