public interface Menu extends Serializable
Modifier and Type | Interface and Description |
---|---|
static interface |
Menu.Command
This interface contains the layer for menu commands of the
MenuBar class. |
Modifier and Type | Method and Description |
---|---|
MenuItem |
addItem(String caption,
Menu.Command command)
Add a new item to the menu bar.
|
MenuItem |
addItem(String caption,
com.vaadin.server.Resource icon,
Menu.Command command)
Add a new item to the menu bar.
|
MenuItem |
addItemBefore(String caption,
com.vaadin.server.Resource icon,
Menu.Command command,
MenuItem itemToAddBefore)
Add an item before some item.
|
List<MenuItem> |
getItems()
Returns a list with all the MenuItem objects in the menu bar
|
int |
getSize()
Returns the size of the menu.
|
boolean |
isHtmlContentAllowed()
Checks whether item captions are interpreted as html or plain text.
|
void |
removeItem(MenuItem item)
Remove first occurrence the specified item from the main menu
|
void |
removeItems()
Empty the menu bar
|
void |
setHtmlContentAllowed(boolean htmlContentAllowed)
Sets whether html is allowed in the item captions.
|
MenuItem addItem(String caption, Menu.Command command)
caption
- the text for the menu itemcommand
- the command for the menu itemIllegalArgumentException
MenuItem addItem(String caption, com.vaadin.server.Resource icon, Menu.Command command)
caption
- the text for the menu itemicon
- the icon for the menu itemcommand
- the command for the menu itemIllegalArgumentException
MenuItem addItemBefore(String caption, com.vaadin.server.Resource icon, Menu.Command command, MenuItem itemToAddBefore)
caption
- the text for the menu itemicon
- the icon for the menu itemcommand
- the command for the menu itemitemToAddBefore
- the item that will be after the new itemIllegalArgumentException
List<MenuItem> getItems()
void removeItem(MenuItem item)
item
- The item to be removedvoid removeItems()
int getSize()
void setHtmlContentAllowed(boolean htmlContentAllowed)
htmlContentAllowed
- true if the captions are used as html, false if used as plain
textboolean isHtmlContentAllowed()
setHtmlContentAllowed(boolean)
Copyright © 2017 Magnolia International Ltd.. All rights reserved.