List of usage examples for com.google.gwt.user.client.ui MenuItemSeparator getParentMenu
public MenuBar getParentMenu()
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); } }