List of usage examples for com.google.gwt.user.client.ui MenuItem setParentMenu
void setParentMenu(MenuBar parentMenu)
From source file:com.vaadin.client.ui.menubar.MenuBar.java
License:Apache License
/** * Adds a menu item to the bar./*from ww w . j ava 2s. co m*/ * * @param item * the item to be added */ public void addItem(MenuItem item) { Element tr; if (vertical) { tr = DOM.createTR(); DOM.appendChild(body, tr); } else { tr = DOM.getChild(body, 0); } DOM.appendChild(tr, item.getElement()); item.setParentMenu(this); item.setSelectionStyle(false); items.add(item); }