use of org.geosdi.geoplatform.gui.configuration.composite.menu.puregwt.event.GPTreeMenuGroupEnableEvent in project geo-platform by geosdi.
the class GPMenuActionBinder method addMenuActionEnableHandler.
/**
* @param action
* @param item
*/
@Override
public void addMenuActionEnableHandler(MenuAction action, final MenuItem item) {
checkArgument(action != null, "The Parameter action must not be null.");
checkArgument(item != null, "The Parameter item must not be null.");
action.addActionEnableHandler(new ActionEnableHandler() {
@Override
public void onActionEnabled(ActionEnableEvent event) {
item.setEnabled(event.isEnabled());
if ((menuCreator instanceof AbstractTreeMenuStrategy) && (item.getParentMenu() != null) && (item.getParentMenu().getParentItem() != null) && (item.getParentMenu().getParentItem() instanceof MenuItem) && ((MenuItem) (item.getParentMenu().getParentItem())).getSubMenu() != null) {
Menu menu = item.getParentMenu();
GPMenuActionHandlerManager.fireEventFromSource(new GPTreeMenuGroupEnableEvent(), menu.getId());
}
}
});
}
Aggregations