* @param scope
*/
protected void processOperations( IWorkbench workbench ){
IHandlerService handlers = (IHandlerService)workbench.getService( IHandlerService.class );
ICommandService commands = (ICommandService)workbench.getService( ICommandService.class );
IMenuService menuService = (IMenuService) workbench.getService(IMenuService.class);
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
List<IConfigurationElement> list = ExtensionPointList.getExtensionPointList("org.locationtech.udig.ui.operation"); //$NON-NLS-1$
List<IConfigurationElement> categoryElements = listCategories(list);
if( categoryElements == null || categoryElements.isEmpty() ) return;
for( IConfigurationElement element : categoryElements ) {
final String ID = element.getAttribute("id");
final String NAME = element.getName();
final String DESCRIPTION = element.getName();
List<IConfigurationElement> operationElements = listOperationsForCategory(list, ID );
try {
// Do not create operation category anymore; only worked for one window
// categories.put(ID, new OperationCategory(element)); //$NON-NLS-1$
// Create a Command Category
Category category = commands.getCategory(ID);
if( !category.isDefined()){
category.define(NAME, DESCRIPTION);
}
// TODO: Create an ActionSet
// TODO: Create a Definition to Check the ActionSet
// TODO: Create the MenuGroup
AbstractContributionFactory categoryAdditions = operationsMenu( menuService, operationElements, "menu:nav?after=layer.ext", ID);
menuService.addContributionFactory(categoryAdditions);
} catch (Exception e) {
UiPlugin.log("Operation category "+ID+":"+e, e);
}
}