import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * <p>
- * DynamicFeatureMenu class.
- * </p>
*
* @author n.hoffmann
* @created 17.04.2009
*/
public class DynamicFeatureMenu extends CompoundContributionItem {
- private final ISelectionService selectionService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(ISelectionService.class);
- private final IHandlerService handlerService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(IHandlerService.class);
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
/** {@inheritDoc} */
@Override
protected IContributionItem[] getContributionItems() {
return new IContributionItem[] { new ContributionItem() {
@Override
public void fill(Menu menu, int index) {
+ ISelectionService selectionService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getSelectionService();
- ISelection selection = selectionService
- .getSelection(DescriptiveViewPart.ID);
+ ISelection selection = selectionService.getSelection(DescriptiveViewPart.ID);
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
Event event = new Event();
event.data = deproxiedFeature;
try {
- handlerService.executeCommand(
+ TaxeditorEditorPlugin.getDefault().getWorkbench().getService(IHandlerService.class).executeCommand(
CreateDescriptionElementOperation.ID, event);
} catch (Exception e) {
MessagingUtils.error(getClass(), e);