org.pietschy.command

Interface IconFactory

Known Implementing Classes:
AbstractReflectionIconFactory, MyAbstractReflectionIconFactory

public interface IconFactory

Icon factories are used by the command manager to create icons whenever the icon type is specified as icon-factory. By implementing this interface you can get complete control over how icons are loaded from the face configuration elements.

For example, a icon configuration of

   <icon type="icon-factory">abcd<icon>
will result in a call to createIcon(String) where the parameter value is abcd.

The factory must be configured in the CommandManager prior to any configuration file being loaded.

See Also:
CommandManager.setIconFactory(IconFactory), AbstractReflectionIconFactory

Method Summary

Icon
createIcon(String parameters)
Creates a new icon based on the specified parameter string.

Method Details

createIcon

public Icon createIcon(String parameters)
            throws Exception
Creates a new icon based on the specified parameter string.
Parameters:
parameters - the icon text as specified by the configuration file.
Returns:
an Icon instance based on the specified parameters.