use of org.geosdi.geoplatform.gui.action.menu.OAuth2MenuBaseAction in project geo-platform by geosdi.
the class GPMenuBarBuilder method addOAuth2MenuItem.
/**
* Add a MenuItem with sub menu
*
* @param tool
* @param menu
*/
@Override
public void addOAuth2MenuItem(OAuth2MenuBarClientTool tool, Menu menu) {
OAuth2MenuBaseAction action = (OAuth2MenuBaseAction) menuRegistar.get(tool.getId());
final MenuItem item = new MenuItem(tool.getText());
if (action != null) {
action.setId(tool.getId());
item.setIcon(action.getImage());
item.setItemId(action.getId());
item.addSelectionListener(action);
this.menuActionBinder.addMenuActionEnableHandler(action, item);
action.addMenuActionChangeIconHandler(new MenuActionChangeIconHandler() {
@Override
public void onActionChangeIcon(MenuActionChangeIconEvent event) {
item.setIcon(event.getImage());
}
});
action.setEnabled(tool.isEnabled());
action.setGoogleAuthUrl(tool.getGoogleAuthUrl());
action.setGoogleClientId(tool.getGoogleClientId());
action.setScope(tool.getScope());
}
menu.add(item);
}
Aggregations