public interface SideMenu extends Component.BelongToFrame, Component.Focusable
Modifier and Type | Interface and Description |
---|---|
static interface |
SideMenu.MenuItem
Menu item
|
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.OptionsStyleProvider, Component.Wrapper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS
Modifier and Type | Method and Description |
---|---|
void |
addMenuItem(SideMenu.MenuItem menuItem)
Add menu item to the end of root items list.
|
void |
addMenuItem(SideMenu.MenuItem menuItem,
int index)
Add menu item to specified position in the root items list.
|
SideMenu.MenuItem |
createMenuItem(java.lang.String id)
Create new menu item.
|
SideMenu.MenuItem |
createMenuItem(java.lang.String id,
java.lang.String caption)
Create new menu item.
|
SideMenu.MenuItem |
createMenuItem(java.lang.String id,
java.lang.String caption,
java.lang.String icon,
java.util.function.Consumer<SideMenu.MenuItem> command)
Create new menu item.
|
SideMenu.MenuItem |
getMenuItem(java.lang.String id) |
SideMenu.MenuItem |
getMenuItemNN(java.lang.String id) |
java.util.List<SideMenu.MenuItem> |
getMenuItems() |
SideMenu.MenuItem |
getSelectedItem() |
Component |
getSidePanel() |
Button |
getSidePanelToggleButton() |
boolean |
hasMenuItems() |
boolean |
isSelectOnClick() |
boolean |
isShowSingleExpandedMenu() |
void |
loadMenuConfig()
Load menu structure from
MenuConfig |
void |
removeAllMenuItems()
Remove all the root menu items.
|
void |
removeMenuItem(int index)
Remove menu item from the root items list by index.
|
void |
removeMenuItem(SideMenu.MenuItem menuItem)
Remove menu item from the root items list.
|
void |
setSelectedItem(SideMenu.MenuItem selectedItem)
Set selected item.
|
void |
setSelectOnClick(boolean selectOnClick)
Enable or disable automatic selected styling by click.
|
void |
setShowSingleExpandedMenu(boolean singleExpandedMenu)
Set true for collapsing a submenu when another parent menu item is clicked
|
void |
setSidePanel(Component sidePanel)
Bind side panel for show/hide action.
|
void |
setSidePanelToggleButton(Button button)
Bind show/hide side panel action to button.
|
getFrame, setFrame
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, getWidthUnits, isEnabled, isEnabledItself, isEnabledRecursive, isResponsive, isVisible, isVisibleItself, isVisibleRecursive, removeStyleName, requestFocus, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
static final java.lang.String NAME
void loadMenuConfig()
MenuConfig
void setSidePanelToggleButton(Button button)
button
- button that should trigger show/hide of side panelButton getSidePanelToggleButton()
void setSidePanel(Component sidePanel)
sidePanel
- side panelComponent getSidePanel()
boolean isSelectOnClick()
void setSelectOnClick(boolean selectOnClick)
selectOnClick
- enable/disable option@Nullable SideMenu.MenuItem getSelectedItem()
void setSelectedItem(@Nullable SideMenu.MenuItem selectedItem)
selectedItem
- new selected itemSideMenu.MenuItem createMenuItem(java.lang.String id)
id
- item idSideMenu.MenuItem createMenuItem(java.lang.String id, java.lang.String caption)
id
- item idcaption
- item captionSideMenu.MenuItem createMenuItem(java.lang.String id, java.lang.String caption, @Nullable java.lang.String icon, @Nullable java.util.function.Consumer<SideMenu.MenuItem> command)
id
- item idcaption
- item captionicon
- iconcommand
- commandvoid addMenuItem(SideMenu.MenuItem menuItem)
menuItem
- menu itemvoid addMenuItem(SideMenu.MenuItem menuItem, int index)
menuItem
- menu itemindex
- target indexvoid removeMenuItem(SideMenu.MenuItem menuItem)
menuItem
- menu itemvoid removeMenuItem(int index)
index
- indexvoid removeAllMenuItems()
@Nullable SideMenu.MenuItem getMenuItem(java.lang.String id)
id
- item idSideMenu.MenuItem getMenuItemNN(java.lang.String id)
id
- item idjava.lang.IllegalArgumentException
- if not foundjava.util.List<SideMenu.MenuItem> getMenuItems()
boolean hasMenuItems()
void setShowSingleExpandedMenu(boolean singleExpandedMenu)
singleExpandedMenu
- boolean isShowSingleExpandedMenu()