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:
- Text label cross referencing to a properties file.
- Action lookups.
Field Summary |
protected java.util.Hashtable |
button_group
The button group indexed by its name. |
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 java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
button_group
protected java.util.Hashtable button_group
- The button group indexed by its name.
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 locationactionList
- 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 locationactionList
- array of UIAction objects to map to
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