org.browsecode.helpers.menus
Interface Menu

All Superinterfaces:
MenuItem
All Known Implementing Classes:
MenuJMenu, MenuStub

public interface Menu
extends MenuItem


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.browsecode.helpers.menus.MenuItem
MenuItem.MenuItemSelectedListener
 
Method Summary
 void addSeparator()
          Since it's unclear whether or not an item has actually been added and where, this method should check to see whether the last item was a separator, and only add one if there was not one already.
 CheckboxMenuItem getCheckboxMenuItem(java.lang.String title, javax.swing.Icon icon, int acceleratorLetter)
           
 CheckboxMenuItem getCheckboxMenuItem(java.lang.String title, javax.swing.Icon icon, javax.swing.KeyStroke accelerator)
           
 Menu getMenu(java.lang.String title)
          Will get an existing item or create a new item and add it if it does not exist.
 MenuItem getMenuItem(java.lang.String title)
          Will get an existing item or create a new item and add it if it does not exist.
 MenuItem getMenuItem(java.lang.String title, javax.swing.Icon icon)
          Will get an existing item or create a new item and add it if it does not exist.
 MenuItem getMenuItem(java.lang.String title, javax.swing.Icon icon, int acceleratorLetter)
          Will get an existing item or create a new item and add it if it does not exist.
 MenuItem getMenuItem(java.lang.String title, javax.swing.Icon icon, javax.swing.KeyStroke accelerator)
          Will get an existing item or create a new item and add it if it does not exist.
 java.lang.String getTitle()
          Get the title that is used to get and refer to this item.
 MenuItem hasMenuItem(java.lang.String title)
          Return an existing item.
 
Methods inherited from interface org.browsecode.helpers.menus.MenuItem
addActionListener, getFont, getVisibleTitle, removeActionListener, setBackgroundColor, setEnabledDisabled, setFont, setForegroundColor, setToolTipText, setVisibleTitle
 

Method Detail

hasMenuItem

MenuItem hasMenuItem(java.lang.String title)
Return an existing item. Return null if there is no item that exists.

Parameters:
title -
Returns:

getMenuItem

MenuItem getMenuItem(java.lang.String title)
Will get an existing item or create a new item and add it if it does not exist.

Parameters:
title -
Returns:

getMenuItem

MenuItem getMenuItem(java.lang.String title,
                     javax.swing.Icon icon)
Will get an existing item or create a new item and add it if it does not exist.

Parameters:
title -
Returns:

getMenuItem

MenuItem getMenuItem(java.lang.String title,
                     javax.swing.Icon icon,
                     int acceleratorLetter)
Will get an existing item or create a new item and add it if it does not exist.

Parameters:
title -
accellerator - the key to execute this menu item on -- this should be taken from KeyEvent, anything that starts with VK_, for example: getMenuItem("Select All", null, KeyEvent_VK_A);
Returns:

getMenuItem

MenuItem getMenuItem(java.lang.String title,
                     javax.swing.Icon icon,
                     javax.swing.KeyStroke accelerator)
Will get an existing item or create a new item and add it if it does not exist.

Parameters:
title -
accellerator - the KeyStroke to execute this menu item on.
Returns:

getCheckboxMenuItem

CheckboxMenuItem getCheckboxMenuItem(java.lang.String title,
                                     javax.swing.Icon icon,
                                     int acceleratorLetter)

getCheckboxMenuItem

CheckboxMenuItem getCheckboxMenuItem(java.lang.String title,
                                     javax.swing.Icon icon,
                                     javax.swing.KeyStroke accelerator)

getMenu

Menu getMenu(java.lang.String title)
Will get an existing item or create a new item and add it if it does not exist.

Parameters:
title -
Returns:

addSeparator

void addSeparator()
Since it's unclear whether or not an item has actually been added and where, this method should check to see whether the last item was a separator, and only add one if there was not one already.


getTitle

java.lang.String getTitle()
Description copied from interface: MenuItem
Get the title that is used to get and refer to this item. It is language/locale independent and may not actually be the visible title of the item. This should generally not be changed over the course of the menu item's life.

Specified by:
getTitle in interface MenuItem