net.sf.genuine.organizer.internal
Class Menu

java.lang.Object
  extended bynet.sf.genuine.organizer.internal.Item
      extended bynet.sf.genuine.organizer.internal.MenuItem
          extended bynet.sf.genuine.organizer.internal.Menu
Direct Known Subclasses:
MenuBar

class Menu
extends MenuItem

Implementation class that belongs to MenuBarBuilder. Instances hold a menu with sub menu entries, either menus or menu items.

Author:
Tim Wellhausen

Constructor Summary
(package private) Menu()
          Empty
(package private) Menu(Module module, org.jdom.Element menuElement, boolean showIcon)
          Creates a new menu and adds all menu items that the given element contains.
 
Method Summary
(package private)  void addMenuEntries(Module module, java.util.List menuEntryElements)
          Adds all menu entries from the given list of menu entry elements to this menu.
(package private)  javax.swing.JMenuItem createJMenuItem()
          Returns a JMenu instance filled with JMenuItem entries corresponding to the menu / menu items defined by all modules.
protected  GenuineAction getAction()
          Returns the action instance that is referred to by this objects id by retrieving it from the module.
protected  java.lang.String getBehindOfItemId()
          This menu item may have declared to be put behind another menu item.
protected  java.lang.String getId()
          Returns the menu item's id.
protected  java.lang.String getInFrontOfItemId()
          This menu item may have declared to be put in front of another menu item.
protected  boolean isSeparatorBehind()
          Returns true if a separator should appear behind this menu item.
protected  boolean isSeparatorInFront()
          Returns true if a separator should appear in front of this menu item.
protected  boolean shouldMenuEntriesShowIcons()
          Returns whether the menu entris of this menu should show icons.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Menu

Menu()
Empty


Menu

Menu(Module module,
     org.jdom.Element menuElement,
     boolean showIcon)
throws ConfigurationException
Creates a new menu and adds all menu items that the given element contains.

Parameters:
menuElement - Contains description of menu
showIcon - True if this menu should show an icon
Method Detail

addMenuEntries

void addMenuEntries(Module module,
                    java.util.List menuEntryElements)
              throws ConfigurationException
Adds all menu entries from the given list of menu entry elements to this menu. Each entry is either another menu or a menu item.

Throws:
ConfigurationException

shouldMenuEntriesShowIcons

protected boolean shouldMenuEntriesShowIcons()
Returns whether the menu entris of this menu should show icons. Is overriden by MenuBar so that no menu in the menu bar shows icons.


createJMenuItem

javax.swing.JMenuItem createJMenuItem()
                                throws ConfigurationException
Returns a JMenu instance filled with JMenuItem entries corresponding to the menu / menu items defined by all modules.

Overrides:
createJMenuItem in class MenuItem
Throws:
ConfigurationException

getId

protected java.lang.String getId()
Returns the menu item's id.


isSeparatorInFront

protected boolean isSeparatorInFront()
Returns true if a separator should appear in front of this menu item.


isSeparatorBehind

protected boolean isSeparatorBehind()
Returns true if a separator should appear behind this menu item.


getInFrontOfItemId

protected java.lang.String getInFrontOfItemId()
This menu item may have declared to be put in front of another menu item. If that is the case this method returns the id of the other menu item, otherwise null.


getBehindOfItemId

protected java.lang.String getBehindOfItemId()
This menu item may have declared to be put behind another menu item. If that is the case this method returns the id of the other menu item, otherwise null.


getAction

protected GenuineAction getAction()
                           throws ConfigurationException
Returns the action instance that is referred to by this objects id by retrieving it from the module.

Throws:
ConfigurationException