public interface AppMenu extends Component.BelongToFrame, Component.Focusable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
AppMenu.MenuItem
Menu item
|
Component.ActionOwner, Component.ActionsHolder, Component.Alignment, Component.BelongToFrame, Component.Buffered, Component.ChildEditableController, Component.Collapsable, Component.Container, Component.ContextHelpIconClickEvent, Component.Disposable, Component.Editable, Component.EditableChangeEvent, Component.EditableChangeListener, Component.EditableChangeNotifier, Component.ExpandedStateChangeEvent, Component.ExpandedStateChangeListener, Component.Focusable, Component.HasBorder, Component.HasButtonsPanel, Component.HasCaption, Component.HasContextHelp, Component.HasFormatter, Component.HasIcon, Component.HasInputPrompt, Component.HasNamedComponents, Component.HasOptionsStyleProvider, Component.HasPresentations, Component.HasRowsCount, Component.HasSettings, Component.HasValue, Component.HasXmlDescriptor, Component.LayoutClickEvent, Component.LayoutClickListener, Component.LayoutClickNotifier, Component.Margin, Component.MouseEventDetails, Component.OptionsStyleProvider, Component.OrderedContainer, Component.OuterMargin, Component.SecuredActionsHolder, Component.ShortcutAction, Component.ShortcutNotifier, Component.ShortcutTriggeredEvent, Component.Spacing, Component.UiPermissionAware, Component.Validatable, Component.ValueChangeEvent, Component.ValueChangeListener, Component.Wrapper| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
AUTO_SIZE, AUTO_SIZE_PX, UNITS_PERCENTAGE, UNITS_PIXELS| Modifier and Type | Method and Description |
|---|---|
void |
addMenuItem(AppMenu.MenuItem menuItem)
Add menu item to the end of root items list.
|
void |
addMenuItem(AppMenu.MenuItem menuItem,
int index)
Add menu item to specified position in the root items list.
|
AppMenu.MenuItem |
createMenuItem(java.lang.String id)
Create new menu item.
|
AppMenu.MenuItem |
createMenuItem(java.lang.String id,
java.lang.String caption)
Create new menu item.
|
AppMenu.MenuItem |
createMenuItem(java.lang.String id,
java.lang.String caption,
java.lang.String icon,
java.util.function.Consumer<AppMenu.MenuItem> command)
Create new menu item.
|
AppMenu.MenuItem |
createSeparator()
Creates menu separator
|
AppMenu.MenuItem |
getMenuItem(java.lang.String id) |
AppMenu.MenuItem |
getMenuItemNN(java.lang.String id) |
java.util.List<AppMenu.MenuItem> |
getMenuItems() |
boolean |
hasMenuItems() |
void |
loadMenu()
Load menu structure from
MenuConfig |
void |
removeMenuItem(AppMenu.MenuItem menuItem)
Remove menu item from the root items list.
|
void |
removeMenuItem(int index)
Remove menu item from the root items list by index.
|
void |
setMenuItemShortcutCaption(AppMenu.MenuItem menuItem,
java.lang.String shortcut)
Sets caption to MenuItem with value of shortcut key combination.
|
getFrame, setFramegetTabIndex, isFocusable, setFocusable, setTabIndexaddStyleName, getAlignment, getDebugId, getHeight, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthUnits, isEnabled, isEnabledItself, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setDebugId, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapCompositionstatic final java.lang.String NAME
void loadMenu()
MenuConfigAppMenu.MenuItem createMenuItem(java.lang.String id)
id - item idAppMenu.MenuItem createMenuItem(java.lang.String id, java.lang.String caption)
id - item idcaption - item captionAppMenu.MenuItem createMenuItem(java.lang.String id, java.lang.String caption, @Nullable java.lang.String icon, @Nullable java.util.function.Consumer<AppMenu.MenuItem> command)
id - item idcaption - item captionicon - iconcommand - commandvoid addMenuItem(AppMenu.MenuItem menuItem)
menuItem - menu itemvoid addMenuItem(AppMenu.MenuItem menuItem, int index)
menuItem - menu itemindex - target indexvoid removeMenuItem(AppMenu.MenuItem menuItem)
menuItem - menu itemvoid removeMenuItem(int index)
index - index@Nullable AppMenu.MenuItem getMenuItem(java.lang.String id)
id - item idAppMenu.MenuItem getMenuItemNN(java.lang.String id)
id - item idjava.lang.IllegalArgumentException - if not foundjava.util.List<AppMenu.MenuItem> getMenuItems()
boolean hasMenuItems()
AppMenu.MenuItem createSeparator()
void setMenuItemShortcutCaption(AppMenu.MenuItem menuItem, java.lang.String shortcut)
menuItem - MenuItem instanceshortcut - shortcut key combination string representation