bibliothek.gui.dock.station.flap.button
Class AbstractButtonContentCondition

java.lang.Object
  extended by bibliothek.gui.dock.station.flap.button.AbstractButtonContentCondition
All Implemented Interfaces:
DockableListener, ButtonContentCondition

public abstract class AbstractButtonContentCondition
extends Object
implements ButtonContentCondition, DockableListener

This abstract implementation of a ButtonContentCondition adds itself as DockableListener to any Dockable that is installed. Subclasses may override the methods of the DockableListener and react on changes (the default behavior is always to do nothing).

Author:
Benjamin Sigg

Constructor Summary
AbstractButtonContentCondition()
           
 
Method Summary
protected  void fire(Dockable dockable)
          Calls the method ButtonContent.handleChange(Dockable) on all ButtonContents that are currently using this ButtonContentCondition that that have installed dockable.
protected  void install(Dockable dockable)
          Called when dockable has to be observered.
 void install(Dockable dockable, ButtonContent content)
          Informs this ButtonContentCondition that dockable has to be monitored for changes.
 void titleBound(Dockable dockable, DockTitle title)
          Will be invoked when a DockTitle was bound to a Dockable.
 void titleExchanged(Dockable dockable, DockTitle title)
          Invoked when the properties of a Dockable have a so dramatically changed, that the DockTitle title is no longer considered a good title and should be replaced.
 void titleIconChanged(Dockable dockable, Icon oldIcon, Icon newIcon)
          Invoked when the title-icon of a Dockable has changed
 void titleTextChanged(Dockable dockable, String oldTitle, String newTitle)
          Invoked when the title of a Dockable has changed.
 void titleToolTipChanged(Dockable dockable, String oldToolTip, String newToolTip)
          Called when the tooltip of a Dockable changed.
 void titleUnbound(Dockable dockable, DockTitle title)
          Will be invoked when a DockTitle was unbound from a Dockable.
protected  void uninstall(Dockable dockable)
          Called when dockable no longer has to be observed.
 void uninstall(Dockable dockable, ButtonContent content)
          Informs this ButtonContentCondition that dockable no longer has to be monitored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.station.flap.button.ButtonContentCondition
shouldShow
 

Constructor Detail

AbstractButtonContentCondition

public AbstractButtonContentCondition()
Method Detail

install

public void install(Dockable dockable,
                    ButtonContent content)
Description copied from interface: ButtonContentCondition
Informs this ButtonContentCondition that dockable has to be monitored for changes.

Specified by:
install in interface ButtonContentCondition
Parameters:
dockable - the element to monitor
content - the ButtonContent which is using this condition and whose method ButtonContent.handleChange(Dockable) should be called if this condition changes its value for dockable

uninstall

public void uninstall(Dockable dockable,
                      ButtonContent content)
Description copied from interface: ButtonContentCondition
Informs this ButtonContentCondition that dockable no longer has to be monitored

Specified by:
uninstall in interface ButtonContentCondition
Parameters:
dockable - the element that no longer has to be monitored
content - the ButtonContent which was using this condition

fire

protected void fire(Dockable dockable)
Calls the method ButtonContent.handleChange(Dockable) on all ButtonContents that are currently using this ButtonContentCondition that that have installed dockable.

Parameters:
dockable - the element whose properties have changed

install

protected void install(Dockable dockable)
Called when dockable has to be observered.

Parameters:
dockable - the element to observe

uninstall

protected void uninstall(Dockable dockable)
Called when dockable no longer has to be observed.

Parameters:
dockable - the element that no longer needs to be osbserved

titleBound

public void titleBound(Dockable dockable,
                       DockTitle title)
Description copied from interface: DockableListener
Will be invoked when a DockTitle was bound to a Dockable.

Specified by:
titleBound in interface DockableListener
Parameters:
dockable - the Dockable whose title is set
title - the new title

titleExchanged

public void titleExchanged(Dockable dockable,
                           DockTitle title)
Description copied from interface: DockableListener
Invoked when the properties of a Dockable have a so dramatically changed, that the DockTitle title is no longer considered a good title and should be replaced. The one element which shows title should unbind it, and request a new title.

Specified by:
titleExchanged in interface DockableListener
Parameters:
dockable - the source of the event
title - the title that should be discarded, can be null to alert elements which do show the null-title

titleIconChanged

public void titleIconChanged(Dockable dockable,
                             Icon oldIcon,
                             Icon newIcon)
Description copied from interface: DockableListener
Invoked when the title-icon of a Dockable has changed

Specified by:
titleIconChanged in interface DockableListener
Parameters:
dockable - the Dockable whose title is changed
oldIcon - the old icon, may be null
newIcon - the new icon, may be null

titleTextChanged

public void titleTextChanged(Dockable dockable,
                             String oldTitle,
                             String newTitle)
Description copied from interface: DockableListener
Invoked when the title of a Dockable has changed.

Specified by:
titleTextChanged in interface DockableListener
Parameters:
dockable - the Dockable whose title is changed
oldTitle - the title before the change
newTitle - the title after the change

titleToolTipChanged

public void titleToolTipChanged(Dockable dockable,
                                String oldToolTip,
                                String newToolTip)
Description copied from interface: DockableListener
Called when the tooltip of a Dockable changed.

Specified by:
titleToolTipChanged in interface DockableListener
Parameters:
dockable - the dockable whose tooltip changed
oldToolTip - the old value
newToolTip - the new value

titleUnbound

public void titleUnbound(Dockable dockable,
                         DockTitle title)
Description copied from interface: DockableListener
Will be invoked when a DockTitle was unbound from a Dockable.

Specified by:
titleUnbound in interface DockableListener
Parameters:
dockable - the Dockable whose title was removed
title - the remove title