bibliothek.gui.dock.themes.icon
Class TabMenuOverflowIconBridge

java.lang.Object
  extended by bibliothek.gui.dock.themes.icon.TabMenuOverflowIconBridge
All Implemented Interfaces:
DockIconBridge, UIBridge<Icon,DockIcon>

public class TabMenuOverflowIconBridge
extends Object
implements DockIconBridge

This DockIconBridge searches for TabMenuDockIcons and sets a custom icon using the current size of the TabMenu to select the icon.
This bridge must be installed at the IconManager using TabMenuDockIcon.KIND_TAB_MENU as path of the type. Clients may subclass this bridge and override createIcon(TabMenu) in order to use a custom icon. This bridge assumes that ICON_KEY is not set, the bridges disables itself if the icon is set by the client.

Author:
Benjamin Sigg

Field Summary
static String ICON_KEY
          The key of the icon that is observed by this bridge
 
Constructor Summary
TabMenuOverflowIconBridge()
           
 
Method Summary
 void add(String id, DockIcon icon)
          Adds a new UIValue that gets its resource from this bridge.
protected  Icon createIcon(TabMenu menu)
          Returns an icon that represents menu in its current state.
 void remove(String id, DockIcon icon)
          Removes a value from this bridge.
 void set(String id, Icon value, DockIcon icon)
          Called by the UIProperties when one resource or UIValue has been exchanged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICON_KEY

public static final String ICON_KEY
The key of the icon that is observed by this bridge

See Also:
Constant Field Values
Constructor Detail

TabMenuOverflowIconBridge

public TabMenuOverflowIconBridge()
Method Detail

add

public void add(String id,
                DockIcon icon)
Description copied from interface: UIBridge
Adds a new UIValue that gets its resource from this bridge.

Specified by:
add in interface UIBridge<Icon,DockIcon>
Parameters:
id - the id of the resource the new value needs
icon - a value that can be modified by this bride

remove

public void remove(String id,
                   DockIcon icon)
Description copied from interface: UIBridge
Removes a value from this bridge.

Specified by:
remove in interface UIBridge<Icon,DockIcon>
Parameters:
id - the id of the resource the value needed
icon - the value that is no longer in use

set

public void set(String id,
                Icon value,
                DockIcon icon)
Description copied from interface: UIBridge
Called by the UIProperties when one resource or UIValue has been exchanged. Normally an UIBridge can just call UIValue.set(Object) with the argument value.
This method may also be called with an UIValue that was not added to this UIBridge.

Specified by:
set in interface UIBridge<Icon,DockIcon>
Parameters:
id - the identifier of the resource
value - the new resource, can be null
icon - the value that is affected by the change

createIcon

protected Icon createIcon(TabMenu menu)
Returns an icon that represents menu in its current state. This method is called everytime when the number of children of menu changes.

Parameters:
menu - the menu for which an icon is required
Returns:
the icon, can (but should not) be null