net.sf.genuine.organizer.internal
Class MenuItem

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

class MenuItem
extends Item

Implementation class that belongs to MenuBarBuilder. Instances hold a menu item. Every menu item can refer to other menu items for relative positioning. For example, a menu item may request that is should be positioned in front of a specific other menu item. If the other item is not available, an exception will be thrown during initialization. Furtermore, every menu item may request a separator being added in front or behind of it.

Author:
Tim Wellhausen

Constructor Summary
(package private) MenuItem()
          Empty
(package private) MenuItem(org.jdom.Element menuItemElement)
          Reads all information from menu item
(package private) MenuItem(Module module, org.jdom.Element menuItemElement)
          Takes a menu item element and a reference to the module.
 
Method Summary
(package private)  javax.swing.JMenuItem createJMenuItem()
          Create a single menu item that is initialized by an action object that is requested from the module by its id.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuItem

MenuItem()
Empty


MenuItem

MenuItem(org.jdom.Element menuItemElement)
   throws ConfigurationException
Reads all information from menu item


MenuItem

MenuItem(Module module,
         org.jdom.Element menuItemElement)
   throws ConfigurationException
Takes a menu item element and a reference to the module.

Method Detail

createJMenuItem

javax.swing.JMenuItem createJMenuItem()
                                throws ConfigurationException
Create a single menu item that is initialized by an action object that is requested from the module by its id.

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