|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.freehep.xml.menus.XMLMenuBuilder
Create a set of menus by reading an XML file.
Nested Class Summary | |
static class |
XMLMenuBuilder.IllegalDefaultClassException
|
Field Summary | |
static String |
LOCATION_PROPERTY
|
Constructor Summary | |
XMLMenuBuilder()
Create an (empty) XMLMenuBuilder |
Method Summary | |
void |
build(URL xml)
Build an XMLMenuSystem using the default SAX parser. |
void |
build(URL xml,
XMLReader reader)
Build an XMLMenuSystem |
protected Icon |
createIcon(String name)
Override this method for customized icon creation. |
protected JMenu |
createMenu(String className)
Override this method to create your own subclass of JMenu |
protected JMenuBar |
createMenuBar(String className)
Override this method to create your own subclass of JMenuBar |
protected JMenuItem |
createMenuItem(String className,
String name,
String type,
String command)
Override this method to create your own subclass of JMenuItem |
protected JPopupMenu |
createPopupMenu(String className)
Override this method to create your own subclass of JPopupMenu |
protected JToolBar |
createToolBar(String className)
Override this method to create your own subclass of JToolBar |
protected AbstractButton |
createToolBarItem(String className,
String name,
String type,
String command)
Override this method to create your own subclass of JButton |
JMenuBar |
getMenuBar(String id)
Get the menu bar with ID id |
JPopupMenu |
getPopupMenu(String id)
Get the popup menu with ID id |
JToolBar |
getToolBar(String id)
Get the tool bar with ID id |
JPopupMenu |
mergePopupMenu(String id,
JPopupMenu menu)
Merge the popup menu with ID id onto the end of an existing menu |
static void |
setClassLoader(ClassLoader loader)
Set the classloader that will be used to load classes named in the XML |
void |
setDefaultCheckBoxMenuItemClass(Class klass)
sets the default class of checkbox menu items to be klass |
void |
setDefaultMenuBarClass(Class klass)
|
void |
setDefaultMenuClass(Class klass)
sets the default class of menus to be klass |
void |
setDefaultMenuItemClass(Class klass)
sets the default class of menu items to be klass |
void |
setDefaultPopupMenuClass(Class klass)
sets the default class of popup menus to be klass |
void |
setDefaultRadioMenuItemClass(Class klass)
sets the default class of radio menu items to be klass |
void |
setDefaultToolBarClass(Class klass)
sets the default class of toolbars to be klass |
void |
setDefaultToolBarItemClass(Class klass)
sets the default class of menu items to be klass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String LOCATION_PROPERTY
Constructor Detail |
public XMLMenuBuilder()
Method Detail |
public void build(URL xml) throws SAXException, IOException
xml
- The URL from which to read the XML
SAXException
IOException
public void build(URL xml, XMLReader reader) throws SAXException, IOException
xml
- The URL from which to read the XMLreader
- The XMLReader to use to parse the XML
SAXException
IOException
public void setDefaultMenuBarClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultMenuClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JMenu
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultMenuItemClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JMenuItem
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultRadioMenuItemClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JMenuItem
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultCheckBoxMenuItemClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JMenuItem
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultPopupMenuClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JPopupMenu
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultToolBarClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JToolBar
XMLMenuBuilder.IllegalDefaultClassException
public void setDefaultToolBarItemClass(Class klass) throws XMLMenuBuilder.IllegalDefaultClassException
klass
- the new default class, must be a subclass of JButton
XMLMenuBuilder.IllegalDefaultClassException
protected JMenuBar createMenuBar(String className) throws SAXException
SAXException
protected JMenu createMenu(String className) throws SAXException
SAXException
protected JMenuItem createMenuItem(String className, String name, String type, String command) throws SAXException
SAXException
protected JPopupMenu createPopupMenu(String className) throws SAXException
SAXException
protected JToolBar createToolBar(String className) throws SAXException
SAXException
protected AbstractButton createToolBarItem(String className, String name, String type, String command) throws SAXException
SAXException
protected Icon createIcon(String name) throws SAXException
SAXException
public JMenuBar getMenuBar(String id)
public JToolBar getToolBar(String id)
public JPopupMenu getPopupMenu(String id)
public JPopupMenu mergePopupMenu(String id, JPopupMenu menu)
id
- The id of the popup menumenu
- The menu to be mergedpublic static void setClassLoader(ClassLoader loader)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |