nl.cwi.sen1.util
Class MenuBuilder
java.lang.Object
nl.cwi.sen1.util.MenuBuilder
public class MenuBuilder
- extends java.lang.Object
Field Summary |
private toolbus.AbstractTool |
bridge
|
Constructor Summary |
MenuBuilder(toolbus.AbstractTool bridge)
|
Method Summary |
private void |
addMenuPath(javax.swing.JMenu menu,
nl.cwi.sen1.configapi.types.Event event,
javax.swing.Action action)
|
protected javax.swing.Action |
buildMenuAction(aterm.ATerm id,
toolbus.AbstractTool bridge,
nl.cwi.sen1.configapi.types.Event event)
This extension point implements the default reaction to a menu event,
which is forward the event to the ToolBus |
private javax.swing.KeyStroke |
createKeyStroke(nl.cwi.sen1.configapi.types.ShortCut shortcut)
|
void |
fill(javax.swing.JMenu menu,
aterm.ATerm id,
nl.cwi.sen1.configapi.types.ActionDescriptionList menuList,
javax.swing.Action action)
Build a JMenu from a list of menu declarations in ATerm format. |
private javax.swing.JMenu |
findSubMenu(javax.swing.JMenu parent,
java.lang.String text)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bridge
private toolbus.AbstractTool bridge
MenuBuilder
public MenuBuilder(toolbus.AbstractTool bridge)
fill
public void fill(javax.swing.JMenu menu,
aterm.ATerm id,
nl.cwi.sen1.configapi.types.ActionDescriptionList menuList,
javax.swing.Action action)
- Build a JMenu from a list of menu declarations in ATerm format. This
method may skip the first item the menu path leading up to each menu
item, such that the JMenu can be embedded in a menu bar, as well as in a
popup menu.
- Parameters:
id
- the name of the gui element that owns the menumenuList
- the list of menu optionsaction
- if not null, this action will be executed on clicking the menuskip
- the number of labels to skip
buildMenuAction
protected javax.swing.Action buildMenuAction(aterm.ATerm id,
toolbus.AbstractTool bridge,
nl.cwi.sen1.configapi.types.Event event)
- This extension point implements the default reaction to a menu event,
which is forward the event to the ToolBus
- Parameters:
id
- bridge
- event
-
- Returns:
addMenuPath
private void addMenuPath(javax.swing.JMenu menu,
nl.cwi.sen1.configapi.types.Event event,
javax.swing.Action action)
createKeyStroke
private javax.swing.KeyStroke createKeyStroke(nl.cwi.sen1.configapi.types.ShortCut shortcut)
findSubMenu
private javax.swing.JMenu findSubMenu(javax.swing.JMenu parent,
java.lang.String text)