|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.ugent.caagt.swirl.menus.MenuBuilder
public class MenuBuilder
Allows menus to be constructed from a configuration file.
The configuration file uses an XML-format, the DTD of which can be found
here. The corresponding
public identifier is "-//SWIRL//MenuBuilder configuration 1.0//EN
".
More information can be found in the MenuBuilder tutorial.
Constructor Summary | |
---|---|
MenuBuilder()
Create a new object of this type with a default action map. |
|
MenuBuilder(javax.swing.ActionMap actionMap)
Create a new object of this type with the associated action map. |
Method Summary | ||
---|---|---|
javax.swing.JMenuBar |
createJMenuBar(java.lang.String key)
Build a menu bar which corresponds to the root configuration element with the given key. |
|
javax.swing.JPopupMenu |
createJPopupMenu(java.lang.String key)
Build a popup menu which corresponds to the menu configuration element with the given key. |
|
javax.swing.JToolBar |
createJToolBar(java.lang.String key)
Build a tool bar which corresponds to the menu configuration element with the given key. |
|
javax.swing.ActionMap |
getActionMap()
The action map used by this builder |
|
void |
load(java.io.InputStream inputStream,
java.lang.String bundleName)
Load configuration information from the given input stream. |
|
void |
load(java.lang.String resource,
java.lang.String bundleName)
Load configuration information from the given class path resource. |
|
void |
registerAction(java.lang.String id,
javax.swing.Action action)
Register an action this builder. |
|
|
registerGroup(java.lang.String id,
GenericSelectionModel<E> model,
java.lang.Object... namesAndConstants)
Register a selection group |
|
void |
registerToggle(java.lang.String id,
java.awt.event.ItemListener itemListener)
Register an item listener for a toggle. |
|
void |
removePredicate(java.lang.String predicate)
Remove (unset) the predicate with the given name. |
|
void |
setPredicate(java.lang.String predicate)
Set a predicate with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MenuBuilder(javax.swing.ActionMap actionMap)
public MenuBuilder()
Method Detail |
---|
public javax.swing.ActionMap getActionMap()
public void setPredicate(java.lang.String predicate)
public void removePredicate(java.lang.String predicate)
setPredicate(java.lang.String)
public void registerAction(java.lang.String id, javax.swing.Action action)
Has the same effect as registering the action with the action map of this builder.
id
- Identifier used in the configuration file for this actionaction
- Action object to be associated with this identifierpublic void registerToggle(java.lang.String id, java.awt.event.ItemListener itemListener)
id
- Identifier used for this toggle in the configuration fileitemListener
- Item listener to be associated with this identifierpublic <E> void registerGroup(java.lang.String id, GenericSelectionModel<E> model, java.lang.Object... namesAndConstants)
id
- Identifier used for this group in the configuration filemodel
- Selection model to be associated with this groupnamesAndConstants
- List of names and constants for the buttons
in this grouppublic void load(java.lang.String resource, java.lang.String bundleName)
bundleName
- Name of the resource bundle which will be used
to resolve the various keys in the cnofiguration filepublic void load(java.io.InputStream inputStream, java.lang.String bundleName) throws java.io.IOException
bundleName
- Name of the resource bundle which will be used
to resolve the various keys in the cnofiguration file
java.io.IOException
public javax.swing.JMenuBar createJMenuBar(java.lang.String key)
registerAction(java.lang.String, javax.swing.Action)
,
registerToggle(java.lang.String, java.awt.event.ItemListener)
,
registerGroup(java.lang.String, be.ugent.caagt.swirl.GenericSelectionModel, java.lang.Object...)
public javax.swing.JPopupMenu createJPopupMenu(java.lang.String key)
registerAction(java.lang.String, javax.swing.Action)
,
registerToggle(java.lang.String, java.awt.event.ItemListener)
,
registerGroup(java.lang.String, be.ugent.caagt.swirl.GenericSelectionModel, java.lang.Object...)
public javax.swing.JToolBar createJToolBar(java.lang.String key)
registerAction(java.lang.String, javax.swing.Action)
,
registerToggle(java.lang.String, java.awt.event.ItemListener)
,
registerGroup(java.lang.String, be.ugent.caagt.swirl.GenericSelectionModel, java.lang.Object...)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |