import javax.inject.Named;
+import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
}
+ @Override
+ @CanExecute
+ public boolean canExecute(
+ @Named(IServiceConstants.ACTIVE_PART)MPart activePart,
+ @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
+ MHandledMenuItem menuItem){
+
+ editor = (TaxonNameEditorE4) activePart.getObject();
+
+ boolean canExecute = false;
+ Object selectedElement = selection.getFirstElement();
+ canExecute = editor.checkForEmptyNames();
+ menuItem.setVisible(canExecute);
+ return canExecute;
+ }
+
}