Example usage for com.google.gwt.user.client.ui MenuItemSeparator getParentMenu

List of usage examples for com.google.gwt.user.client.ui MenuItemSeparator getParentMenu

Introduction

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

Prototype

public MenuBar getParentMenu() 

Source Link

Document

Gets the menu that contains this item.

Usage

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

License:Apache License

/**
 * {@inheritDoc}//from   w  w  w. jav a2s  .c  o m
 */
@Override
public void removeFromParent() {

    MenuItemSeparator separator = getToplevelWidget();
    MenuBar parentMenu = separator.getParentMenu();
    if (parentMenu != null) {
        parentMenu.removeSeparator(separator);
    }
}

From source file:org.xwiki.gwt.wysiwyg.client.plugin.separator.MenuBarSeparator.java

License:Open Source License

/**
 * Register attach handlers to update the visibility of the menu separators when a menu is displayed.
 *//*from  w  ww  .j  a  va 2 s .co  m*/
public void registerAttachHandlers() {
    handlerRegistrations.removeHandlers();
    Set<MenuBar> menus = new HashSet<MenuBar>();
    for (MenuItemSeparator separator : separators) {
        if (separator.getParentMenu() != null) {
            menus.add(separator.getParentMenu());
        }
    }
    for (MenuBar menu : menus) {
        menu.addAttachHandler(this);
    }
}