bibliothek.gui.dock
Class IconManager.Entry

java.lang.Object
  extended by bibliothek.gui.dock.IconManager.Entry
Enclosing class:
IconManager

private class IconManager.Entry
extends java.lang.Object

A set of icons with different priority and a set of listeners.

Author:
Benjamin Sigg

Field Summary
private  javax.swing.Icon[] icons
           
private  java.lang.String key
           
private  java.util.List<IconManagerListener> listeners
           
 
Constructor Summary
IconManager.Entry(java.lang.String key)
          Creates a new entry.
 
Method Summary
 void add(IconManagerListener listener)
          Adds a listener to this entry
 javax.swing.Icon getIcon()
          Gets the current icon of this entry.
 void remove(IconManagerListener listener)
          Removes a listener from this entry
 void set(Priority priority, javax.swing.Icon icon)
          Replaces the current icon of this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

private java.lang.String key

icons

private javax.swing.Icon[] icons

listeners

private java.util.List<IconManagerListener> listeners
Constructor Detail

IconManager.Entry

public IconManager.Entry(java.lang.String key)
Creates a new entry.

Parameters:
key - the key of this entry
Method Detail

getIcon

public javax.swing.Icon getIcon()
Gets the current icon of this entry.

Returns:
the icon with the highest priority

set

public void set(Priority priority,
                javax.swing.Icon icon)
Replaces the current icon of this entry.

Parameters:
priority - the priority, where to store the icon
icon - the new icon or null

add

public void add(IconManagerListener listener)
Adds a listener to this entry

Parameters:
listener - the new listener

remove

public void remove(IconManagerListener listener)
Removes a listener from this entry

Parameters:
listener - the listener to remove