grendel.ui
Class XMLMenuBuilder

java.lang.Object
  |
  +--grendel.ui.XMLWidgetBuilder
        |
        +--grendel.ui.XMLMenuBuilder

public class XMLMenuBuilder
extends XMLWidgetBuilder

Build a menu bar from an XML data source. This builder supports:


Field Summary
protected  java.util.Hashtable button_group
          The button group indexed by its name.
 
Fields inherited from class grendel.ui.XMLWidgetBuilder
properties, ref
 
Constructor Summary
XMLMenuBuilder(java.lang.Class ref, UIAction[] actionList)
          Build a menu builder which operates on XML formatted data
XMLMenuBuilder(javax.swing.JFrame frame, UIAction[] actionList)
          Build a menu builder which operates on XML formatted data
 
Method Summary
protected  javax.swing.JCheckBoxMenuItem buildCheckBoxMenuItem(org.w3c.dom.Element current)
          Build a JCheckBoxMenuItem.
protected  javax.swing.JComponent buildComponent(org.w3c.dom.Element current)
          Build the component at the current XML element and add to the parent
 javax.swing.JComponent buildFrom(org.w3c.dom.Element element)
           
 javax.swing.JComponent buildFrom(java.io.InputStream stream)
          Read the input stream and build a menubar from it
 javax.swing.JMenu buildMenu(org.w3c.dom.Element element)
           
protected  javax.swing.JMenuItem buildMenuItem(org.w3c.dom.Element current)
          Build a JMenuItem.
protected  javax.swing.JRadioButtonMenuItem buildRadioMenuItem(org.w3c.dom.Element current)
          Build a JRadioMenuItem
protected  javax.swing.JSeparator buildSeparator(org.w3c.dom.Element current)
          Build a JSeparator.
 void configureForOwner(javax.swing.JComponent component)
           
 MenuBarCtrl getComponent()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class grendel.ui.XMLWidgetBuilder
getReferencedLabel, setConfiguration, setReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

button_group

protected java.util.Hashtable button_group
The button group indexed by its name.
Constructor Detail

XMLMenuBuilder

public XMLMenuBuilder(java.lang.Class ref,
                      UIAction[] actionList)
Build a menu builder which operates on XML formatted data
Parameters:
ref - the reference point for properties location
actionList - array of UIAction objects to map to

XMLMenuBuilder

public XMLMenuBuilder(javax.swing.JFrame frame,
                      UIAction[] actionList)
Build a menu builder which operates on XML formatted data
Parameters:
frame - reference point for properties location
actionList - array of UIAction objects to map to
Method Detail

buildFrom

public javax.swing.JComponent buildFrom(java.io.InputStream stream)
Read the input stream and build a menubar from it
Parameters:
stream - the stream containing the XML data

buildMenu

public javax.swing.JMenu buildMenu(org.w3c.dom.Element element)

buildFrom

public javax.swing.JComponent buildFrom(org.w3c.dom.Element element)

getComponent

public MenuBarCtrl getComponent()
Returns:
the menubar built by this builder

configureForOwner

public void configureForOwner(javax.swing.JComponent component)

buildComponent

protected javax.swing.JComponent buildComponent(org.w3c.dom.Element current)
Build the component at the current XML element and add to the parent
Parameters:
current - the current element

buildRadioMenuItem

protected javax.swing.JRadioButtonMenuItem buildRadioMenuItem(org.w3c.dom.Element current)
Build a JRadioMenuItem
Parameters:
current - the element that describes the JRadioMenuItem
Returns:
the built component

buildCheckBoxMenuItem

protected javax.swing.JCheckBoxMenuItem buildCheckBoxMenuItem(org.w3c.dom.Element current)
Build a JCheckBoxMenuItem.
Parameters:
current - the element that describes the JCheckBoxMenuItem
Returns:
the built component

buildSeparator

protected javax.swing.JSeparator buildSeparator(org.w3c.dom.Element current)
Build a JSeparator.
Parameters:
current - the element that describes the JSeparator
Returns:
the built component

buildMenuItem

protected javax.swing.JMenuItem buildMenuItem(org.w3c.dom.Element current)
Build a JMenuItem.
Parameters:
current - the element that describes the JMenuItem
Returns:
the built component

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception