com.dlsc.flexgantt.swing.util
Class MenuCleaner

java.lang.Object
  extended by com.dlsc.flexgantt.swing.util.MenuCleaner

public class MenuCleaner
extends java.lang.Object

A utility class that is used to clean up (popup) menus in such a way that the text of the menu items lines up nicely. Swing messes up menus when some of the items display icons and some do not. This utility class will add blank icons that are based on the found icons to those menu items that do not have an icon otherwise.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
MenuCleaner()
           
 
Method Summary
static void clean(javax.swing.JMenu menu)
          Cleans up the given menu by recursively traversing the menu hierarchy.
static void clean(javax.swing.JPopupMenu popup)
          Cleans up the given popup menu by recursively traversing the menu hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuCleaner

public MenuCleaner()
Method Detail

clean

public static void clean(javax.swing.JPopupMenu popup)
Cleans up the given popup menu by recursively traversing the menu hierarchy.

Parameters:
popup - the target menu to clean up
Since:
1.0

clean

public static void clean(javax.swing.JMenu menu)
Cleans up the given menu by recursively traversing the menu hierarchy.

Parameters:
menu - the target menu to clean up
Since:
1.0