Package it.tidalwave.role.ui.spi
Class MutableIconProviderSupport
java.lang.Object
it.tidalwave.role.ui.spi.MutableIconProviderSupport
- All Implemented Interfaces:
IconProvider
,MutableIconProvider
A convenient support for implementing a
MutableIconProvider
.- Author:
- Fabrizio Giudici
- Status: draft API
-
Field Summary
Fields inherited from interface it.tidalwave.role.ui.IconProvider
_IconProvider_, DEFAULT
Fields inherited from interface it.tidalwave.role.ui.MutableIconProvider
_MutableIconProvider_, PROP_ICON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Registers aPropertyChangeListener
.protected void
fireIconChange
(Icon oldIcon, Icon newIcon) Fires the event notifying thatMutableIconProvider.PROP_ICON
has been changed.void
Unregisters aPropertyChangeListener
.void
Sets the icon.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.tidalwave.role.ui.IconProvider
getIcon
-
Constructor Details
-
MutableIconProviderSupport
public MutableIconProviderSupport()
-
-
Method Details
-
addPropertyChangeListener
Registers aPropertyChangeListener
.- Specified by:
addPropertyChangeListener
in interfaceMutableIconProvider
- Parameters:
listener
- the listener
-
removePropertyChangeListener
Unregisters aPropertyChangeListener
.- Specified by:
removePropertyChangeListener
in interfaceMutableIconProvider
- Parameters:
listener
- the listener
-
setIcon
Sets the icon. Note that implementations don't actually need to do something in this method: for instance, a validMutableIconProvider
can autonomously change icon in function of time (e.g. a blinking icon) or reacting to a change in the context. FIXME: this method does nothing. Probably this is inconsistent with DefaultMutableDisplayable? But that is a Default*, we're just a *Support...- Specified by:
setIcon
in interfaceMutableIconProvider
- Parameters:
icon
- the icon
-
fireIconChange
Fires the event notifying thatMutableIconProvider.PROP_ICON
has been changed.- Parameters:
oldIcon
- the old value of the propertynewIcon
- the new value of the property
-