|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.swing.menu.BasicMenuBuilder
public class BasicMenuBuilder
Nested Class Summary | |
---|---|
static class |
BasicMenuBuilder.Entry
|
static class |
BasicMenuBuilder.Group
|
static class |
BasicMenuBuilder.Menu
|
Nested classes/interfaces inherited from interface com.levigo.util.swing.menu.MenuBuilder |
---|
MenuBuilder.ItemType |
Field Summary |
---|
Fields inherited from interface com.levigo.util.swing.menu.MenuBuilder |
---|
GROUP_DEFAULT, GROUP_EDIT, GROUP_KEY, GROUP_SETTINGS, ITEM_TYPE_KEY |
Constructor Summary | |
---|---|
BasicMenuBuilder(MenuContributor contributor,
BasicMenuBuilder.Menu menu)
|
Method Summary | |
---|---|
MenuBuilder |
findSubMenu(String id)
Find a MenuBuilder for an existing sub-menu. |
List<String> |
getGroups()
Return the (read-only) list of group names already defined. |
Set<String> |
getSubMenuIDs()
Return the (read-only) list of sub-menu ids already defined. |
void |
installAction(Action action)
Install the given action into the default menu group MenuBuilder.GROUP_DEFAULT . |
void |
installAction(String group,
Action action)
Install the given action into the given menu group. |
MenuBuilder |
installSubMenu(String group,
String id,
Action action)
Install a sub-menu and return a MenuBuilder for it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicMenuBuilder(MenuContributor contributor, BasicMenuBuilder.Menu menu)
Method Detail |
---|
public void installAction(Action action)
MenuBuilder
MenuBuilder.GROUP_DEFAULT
.
installAction
in interface MenuBuilder
action
- the Action
to install.public void installAction(String group, Action action)
MenuBuilder
installAction
in interface MenuBuilder
group
- the group into which to install itaction
- the Action
to installMenuBuilder.GROUP_DEFAULT
,
MenuBuilder.GROUP_EDIT
,
MenuBuilder.GROUP_SETTINGS
public List<String> getGroups()
MenuBuilder
getGroups
in interface MenuBuilder
public MenuBuilder findSubMenu(String id)
MenuBuilder
MenuBuilder
for an existing sub-menu. If the sub-menu does not exist, this will
return null
.
findSubMenu
in interface MenuBuilder
id
- the sub-menu's id
MenuBuilder
or null
, if there is no sub-menu with the given
id.public MenuBuilder installSubMenu(String group, String id, Action action)
MenuBuilder
MenuBuilder
for it. If the sub-menu already exists,
this method will throw an IllegalArgumentException
.
installSubMenu
in interface MenuBuilder
group
- the group into which to install itid
- the sub-menu's idaction
- the action describing the sub-menu. Please note that the action's
ActionListener.actionPerformed(java.awt.event.ActionEvent)
is never actually called.
MenuBuilder
for the sub-menupublic Set<String> getSubMenuIDs()
MenuBuilder
getSubMenuIDs
in interface MenuBuilder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |