|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MenuBuilder
The MenuBuilder is responsible for the construction of some kind of menu UI in response to contributions it receives.
Caveat: levigo reserves the right to amend this interface in future releases. Therefore we strongly discourage independent implementations of it.
Nested Class Summary | |
---|---|
static class |
MenuBuilder.ItemType
|
Field Summary | |
---|---|
static String |
GROUP_DEFAULT
The name of the default menu group. |
static String |
GROUP_EDIT
The name of the "edit" menu group. |
static String |
GROUP_KEY
The item type key queried on actions to determine the group name, if no explicit name has been specified upon installation. |
static String |
GROUP_SETTINGS
The name of the "settings" menu group. |
static String |
ITEM_TYPE_KEY
The item type key queried on actions to determine the type of menu item to create. |
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 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. |
Field Detail |
---|
static final String GROUP_DEFAULT
static final String GROUP_EDIT
static final String GROUP_SETTINGS
static final String GROUP_KEY
static final String ITEM_TYPE_KEY
MenuBuilder.ItemType
.
Method Detail |
---|
void installAction(Action action)
GROUP_DEFAULT
.
action
- the Action
to install.void installAction(String group, Action action)
group
- the group into which to install itaction
- the Action
to installGROUP_DEFAULT
,
GROUP_EDIT
,
GROUP_SETTINGS
List<String> getGroups()
MenuBuilder findSubMenu(String id)
MenuBuilder
for an existing sub-menu. If the sub-menu does not exist, this will
return null
.
id
- the sub-menu's id
MenuBuilder
or null
, if there is no sub-menu with the given
id.MenuBuilder installSubMenu(String group, String id, Action action)
MenuBuilder
for it. If the sub-menu already exists,
this method will throw an IllegalArgumentException
.
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-menu
IllegalArgumentException
- if a sub-menu for the given id already exists or any of the
parameters is null
.Set<String> getSubMenuIDs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |