Revision 90cf660a
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SetBasionymHandlerE4.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import javax.inject.Named; |
13 | 13 |
|
14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
14 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
15 | 16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
... | ... | |
19 | 20 |
|
20 | 21 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
21 | 22 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
23 |
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester; |
|
22 | 24 |
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicalGroupBasionymOperation; |
23 | 25 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
24 | 26 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
... | ... | |
46 | 48 |
editor.getTaxon(), selectedTaxonBase, editor); |
47 | 49 |
AbstractUtility.executeOperation(operation); |
48 | 50 |
} |
51 |
|
|
52 |
@CanExecute |
|
53 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
|
54 |
MHandledMenuItem menuItem){ |
|
55 |
boolean canExecute = false; |
|
56 |
Object selectedElement = selection.getFirstElement(); |
|
57 |
canExecute = |
|
58 |
NameEditorMenuPropertyTester.isSynonymInHomotypicalGroupWithMoreSynonyms(selectedElement); |
|
59 |
menuItem.setVisible(canExecute); |
|
60 |
return canExecute; |
|
61 |
} |
|
49 | 62 |
} |
Also available in: Unified diff
ref #6595 Set visibility of context menu items in name editor