jas.util.xmlmenus
Class XMLMenuBuilder

java.lang.Object
  |
  +--jas.util.xmlmenus.XMLMenuBuilder

public class XMLMenuBuilder
extends java.lang.Object


Inner Class Summary
static class XMLMenuBuilder.BadXMLException
          Exception to throw when the result of bad XML (something that should not have gotten past a validating parser) is encountered.
static class XMLMenuBuilder.IllegalDefaultClassException
          Exception to throw when the client programmer tries to set a default class of something to be a class that cannot be upcast to the thing's current default class.
 
Constructor Summary
XMLMenuBuilder(java.io.Reader in, java.lang.String fileName)
          Create am XMLMenuBuilder by reading an XML file
 
Method Summary
 javax.swing.JMenuBar getMenuBar(java.lang.String id)
          get the menu bar(and its contents) with ID id
 javax.swing.JPopupMenu getPopupMenu(java.lang.String id)
          get the popup menu (and its contents) with ID id
 javax.swing.JToolBar getToolBar(java.lang.String id)
          get the tool bar (and its contents) with ID id
 void setDefaultCheckboxMenuItemClass(java.lang.Class klass)
          sets the default class of checkbox menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultImageIconClass(java.lang.Class klass)
          sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultMenuBarClass(java.lang.Class klass)
          sets the default class of menubars to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultMenuClass(java.lang.Class klass)
          sets the default class of menus to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultMenuItemClass(java.lang.Class klass)
          sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultMenuSeparatorClass(java.lang.Class klass)
          sets the default class of menu separator items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultPopupCheckboxMenuItemClass(java.lang.Class klass)
          sets the default class of popup checkbox menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultPopupMenuClass(java.lang.Class klass)
          sets the default class of popup menus to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultPopupMenuItemClass(java.lang.Class klass)
          sets the default class of popup menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultPopupMenuSeparatorClass(java.lang.Class klass)
          sets the default class of popup menu separator items to be klass, which MUST be the default class specified in the constructorr or one of its subclasses
 void setDefaultPopupRadioMenuItemClass(java.lang.Class klass)
          sets the default class of popup radio menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultRadioMenuItemClass(java.lang.Class klass)
          sets the default class of radio menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultToolBarClass(java.lang.Class klass)
          sets the default class of toolbars to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultToolBarItemClass(java.lang.Class klass)
          sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 void setDefaultToolBarSeparatorClass(java.lang.Class klass)
          sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMenuBuilder

public XMLMenuBuilder(java.io.Reader in,
                      java.lang.String fileName)
               throws JASDOMParser.XMLException
Create am XMLMenuBuilder by reading an XML file
Parameters:
in - The XML input
fileName - The file name (for error messages)
Method Detail

setDefaultMenuBarClass

public void setDefaultMenuBarClass(java.lang.Class klass)
                            throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menubars to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultMenuClass

public void setDefaultMenuClass(java.lang.Class klass)
                         throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menus to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultMenuItemClass

public void setDefaultMenuItemClass(java.lang.Class klass)
                             throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultRadioMenuItemClass

public void setDefaultRadioMenuItemClass(java.lang.Class klass)
                                  throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of radio menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultCheckboxMenuItemClass

public void setDefaultCheckboxMenuItemClass(java.lang.Class klass)
                                     throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of checkbox menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultMenuSeparatorClass

public void setDefaultMenuSeparatorClass(java.lang.Class klass)
                                  throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menu separator items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultPopupMenuClass

public void setDefaultPopupMenuClass(java.lang.Class klass)
                              throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of popup menus to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultPopupMenuItemClass

public void setDefaultPopupMenuItemClass(java.lang.Class klass)
                                  throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of popup menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultPopupRadioMenuItemClass

public void setDefaultPopupRadioMenuItemClass(java.lang.Class klass)
                                       throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of popup radio menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultPopupCheckboxMenuItemClass

public void setDefaultPopupCheckboxMenuItemClass(java.lang.Class klass)
                                          throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of popup checkbox menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultPopupMenuSeparatorClass

public void setDefaultPopupMenuSeparatorClass(java.lang.Class klass)
                                       throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of popup menu separator items to be klass, which MUST be the default class specified in the constructorr or one of its subclasses
Parameters:
klass - the new default class

setDefaultToolBarClass

public void setDefaultToolBarClass(java.lang.Class klass)
                            throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of toolbars to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultToolBarItemClass

public void setDefaultToolBarItemClass(java.lang.Class klass)
                                throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultToolBarSeparatorClass

public void setDefaultToolBarSeparatorClass(java.lang.Class klass)
                                     throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

setDefaultImageIconClass

public void setDefaultImageIconClass(java.lang.Class klass)
                              throws XMLMenuBuilder.IllegalDefaultClassException
sets the default class of menu items to be klass, which MUST be the default class specified in the constructor or one of its subclasses
Parameters:
klass - the new default class

getMenuBar

public javax.swing.JMenuBar getMenuBar(java.lang.String id)
get the menu bar(and its contents) with ID id

getToolBar

public javax.swing.JToolBar getToolBar(java.lang.String id)
get the tool bar (and its contents) with ID id

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu(java.lang.String id)
get the popup menu (and its contents) with ID id