IStructuredSelection selection = (IStructuredSelection) PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getSelectionService().getSelection();
Layer layer = (Layer) selection.getFirstElement();
ModalToolCategory modalToolCategory = category;
if( category!=null ){
Interaction key = Interaction.getInteraction(modalToolCategory.getId());
boolean interaction = layer.getInteraction(key);
menuItem.setSelection(interaction);
menuItem.setText(modalToolCategory.getName());
}
}