public class AbstractMenu extends Object implements Menu
Menu.Command
Constructor and Description |
---|
AbstractMenu() |
AbstractMenu(com.vaadin.server.ClientConnector connector) |
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.
|
public AbstractMenu()
public AbstractMenu(com.vaadin.server.ClientConnector connector)
public MenuItem addItem(String caption, Menu.Command command)
Menu
public MenuItem addItem(String caption, com.vaadin.server.Resource icon, Menu.Command command)
Menu
public MenuItem addItemBefore(String caption, com.vaadin.server.Resource icon, Menu.Command command, MenuItem itemToAddBefore)
Menu
addItemBefore
in interface Menu
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 itempublic List<MenuItem> getItems()
Menu
public void removeItem(MenuItem item)
Menu
removeItem
in interface Menu
item
- The item to be removedpublic void removeItems()
Menu
removeItems
in interface Menu
public int getSize()
Menu
public void setHtmlContentAllowed(boolean htmlContentAllowed)
Menu
setHtmlContentAllowed
in interface Menu
htmlContentAllowed
- true if the captions are used as html, false if used as plain
textpublic boolean isHtmlContentAllowed()
Menu
isHtmlContentAllowed
in interface Menu
Menu.setHtmlContentAllowed(boolean)
Copyright © 2017 Magnolia International Ltd.. All rights reserved.