*
* @param manager
*/
public void contribute( IMenuManager manager ) {
IWorkbench workbench = PlatformUI.getWorkbench();
IContextService contextService = (IContextService) workbench.getService(IContextService.class);
Collection<String> active = (Collection<String> )contextService.getActiveContextIds();
MenuManager actionMenu = new MenuManager(name, id);
final String actionExt = "action.ext";
actionMenu.add(new GroupMarker(actionExt)); //$NON-NLS-1$
actionMenu.add(new GroupMarker("modal.ext")); //$NON-NLS-1$
for( ModalItem item : this ) {
ToolProxy tool = (ToolProxy) item;
String categoryId = tool.getCategoryId();
if( contextService.getDefinedContextIds().contains(categoryId)){
// we have an context for this tool category
if( !active.contains( categoryId )){
continue; // skip this category please!
}
}