Example usage for com.google.gwt.user.client.ui MenuItem setParentMenu

List of usage examples for com.google.gwt.user.client.ui MenuItem setParentMenu

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui MenuItem setParentMenu.

Prototype

void setParentMenu(MenuBar parentMenu) 

Source Link

Usage

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);
}