Class MutableIconProviderSupport

java.lang.Object
it.tidalwave.role.ui.spi.MutableIconProviderSupport
All Implemented Interfaces:
IconProvider, MutableIconProvider

public abstract class MutableIconProviderSupport extends Object implements MutableIconProvider
A convenient support for implementing a MutableIconProvider.
Author:
Fabrizio Giudici
Status: draft API
  • Constructor Details

    • MutableIconProviderSupport

      public MutableIconProviderSupport()
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(@Nonnull PropertyChangeListener listener)
      Specified by:
      addPropertyChangeListener in interface MutableIconProvider
      Parameters:
      listener - the listener
    • removePropertyChangeListener

      public void removePropertyChangeListener(@Nonnull PropertyChangeListener listener)
      Unregisters a PropertyChangeListener.
      Specified by:
      removePropertyChangeListener in interface MutableIconProvider
      Parameters:
      listener - the listener
    • setIcon

      public void setIcon(@Nonnull Icon icon)
      Sets the icon. Note that implementations don't actually need to do something in this method: for instance, a valid MutableIconProvider 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 interface MutableIconProvider
      Parameters:
      icon - the icon
    • fireIconChange

      protected void fireIconChange(@Nonnull Icon oldIcon, @Nonnull Icon newIcon)
      Fires the event notifying that MutableIconProvider.PROP_ICON has been changed.
      Parameters:
      oldIcon - the old value of the property
      newIcon - the new value of the property