Package it.tidalwave.role.ui.spi
Class MutableIconProviderSupport
- java.lang.Object
-
- it.tidalwave.role.ui.spi.MutableIconProviderSupport
-
- All Implemented Interfaces:
IconProvider
,MutableIconProvider
public abstract class MutableIconProviderSupport extends java.lang.Object implements MutableIconProvider
A convenient support for implementing aMutableIconProvider
.- 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
Constructors Constructor Description MutableIconProviderSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers aPropertyChangeListener
.protected void
fireIconChange(javax.swing.Icon oldIcon, javax.swing.Icon newIcon)
Fires the event notifying thatMutableIconProvider.PROP_ICON
has been changed.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters aPropertyChangeListener
.void
setIcon(javax.swing.Icon icon)
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
-
-
-
-
Method Detail
-
addPropertyChangeListener
public void addPropertyChangeListener(@Nonnull java.beans.PropertyChangeListener listener)
Registers aPropertyChangeListener
.- Specified by:
addPropertyChangeListener
in interfaceMutableIconProvider
- Parameters:
listener
- the listener
-
removePropertyChangeListener
public void removePropertyChangeListener(@Nonnull java.beans.PropertyChangeListener listener)
Unregisters aPropertyChangeListener
.- Specified by:
removePropertyChangeListener
in interfaceMutableIconProvider
- Parameters:
listener
- the listener
-
setIcon
public void setIcon(@Nonnull javax.swing.Icon icon)
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
protected void fireIconChange(@Nonnull javax.swing.Icon oldIcon, @Nonnull javax.swing.Icon newIcon)
Fires the event notifying thatMutableIconProvider.PROP_ICON
has been changed.- Parameters:
oldIcon
- the old value of the propertynewIcon
- the new value of the property
-
-