Example usage for com.google.gwt.user.client.ui MenuBar removeItem

List of usage examples for com.google.gwt.user.client.ui MenuBar removeItem

Introduction

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

Prototype

public void removeItem(MenuItem item) 

Source Link

Document

Removes the specified menu item from the bar.

Usage

From source file:com.ikon.frontend.client.widget.mainmenu.Bookmark.java

License:Open Source License

/**
 * Resets all widgets on menu//w  w  w .j av a 2 s. c o m
 */
private void resetMenu() {
    if (!bookmarks.isEmpty()) {
        MenuBar subMenuBookmark = Main.get().mainPanel.topPanel.mainMenu.subMenuBookmark;

        for (Iterator<MenuItem> it = bookmarks.iterator(); it.hasNext();) {
            subMenuBookmark.removeItem(it.next());
        }
    }
}

From source file:net.sf.mmm.client.ui.impl.gwt.widget.menu.adapter.UiWidgetAdapterGwtMenuItemBase.java

License:Apache License

/**
 * {@inheritDoc}/*w  w  w  .  ja  v a 2s .co m*/
 */
@Override
public void removeFromParent() {

    // not supported by GWT
    MenuItem item = getToplevelWidget();
    MenuBar menu = item.getParentMenu();
    if (menu != null) {
        menu.removeItem(item);
    }
}