com.alee.laf.menu
Class MenuUtils

java.lang.Object
  extended by com.alee.laf.menu.MenuUtils
All Implemented Interfaces:
javax.swing.SwingConstants

public final class MenuUtils
extends java.lang.Object
implements javax.swing.SwingConstants

This class provides a set of utilities for menu elements. This is a library utility class and its not intended for use outside of the menu elements.

Author:
Mikle Garin

Field Summary
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
MenuUtils()
           
 
Method Summary
static java.lang.String getAcceleratorText(javax.swing.JMenuItem menuItem)
          Returns menu item accelerator text.
static int getIconPlaceholderWidth(javax.swing.JMenuItem menuItem, boolean alignTextToMenuIcons)
          Returns maximum icon width for this menu item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuUtils

public MenuUtils()
Method Detail

getIconPlaceholderWidth

public static int getIconPlaceholderWidth(javax.swing.JMenuItem menuItem,
                                          boolean alignTextToMenuIcons)
Returns maximum icon width for this menu item. It might take into account other menu items within popup menu.

Parameters:
menuItem - menu item to process
alignTextToMenuIcons - whether menu item text should be aligned to icons or not
Returns:
maximum icon width for this menu item

getAcceleratorText

public static java.lang.String getAcceleratorText(javax.swing.JMenuItem menuItem)
Returns menu item accelerator text.

Parameters:
menuItem - menu item to process
Returns:
menu item accelerator text