com.alee.laf.menu
Class MenuItemChangeListener

java.lang.Object
  extended by com.alee.laf.menu.MenuItemChangeListener
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener

public class MenuItemChangeListener
extends java.lang.Object
implements javax.swing.event.ChangeListener

Special menu item change listener required to update popup menu decoration properly.

Author:
Mikle Garin

Field Summary
protected  javax.swing.JMenuItem menuItem
          Listened menu item.
 
Constructor Summary
MenuItemChangeListener(javax.swing.JMenuItem menuItem)
          Constructs new menu item change listener.
 
Method Summary
static MenuItemChangeListener install(javax.swing.JMenuItem menuItem)
          Installs menu item model change listener and returns it.
 void stateChanged(javax.swing.event.ChangeEvent e)
          
static void uninstall(MenuItemChangeListener listener, javax.swing.JMenuItem menuItem)
          Uninstalls menu item model change listener from specified menu item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menuItem

protected javax.swing.JMenuItem menuItem
Listened menu item.

Constructor Detail

MenuItemChangeListener

public MenuItemChangeListener(javax.swing.JMenuItem menuItem)
Constructs new menu item change listener.

Parameters:
menuItem - menu item to listen
Method Detail

install

public static MenuItemChangeListener install(javax.swing.JMenuItem menuItem)
Installs menu item model change listener and returns it.

Parameters:
menuItem - menu item to install listener into
Returns:
installed model change listener

uninstall

public static void uninstall(MenuItemChangeListener listener,
                             javax.swing.JMenuItem menuItem)
Uninstalls menu item model change listener from specified menu item.

Parameters:
listener - listener to uninstall
menuItem - menu item to uninstall listener from

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)

Specified by:
stateChanged in interface javax.swing.event.ChangeListener