Revision 38b32a1d
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteTaxonBaseHandlerE4.java | ||
---|---|---|
151 | 151 |
|
152 | 152 |
@CanExecute |
153 | 153 |
public boolean canExecute( |
154 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
|
154 |
@SuppressWarnings("unused") @Named(IServiceConstants.ACTIVE_PART)MPart activePart,
|
|
155 | 155 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
156 | 156 |
MHandledMenuItem menuItem){ |
157 | 157 |
boolean canExecute = false; |
158 |
Object selectedElement = selection.getFirstElement(); |
|
159 |
canExecute = |
|
160 |
NameEditorMenuPropertyTester.isSynonym(selectedElement) |
|
161 |
|| NameEditorMenuPropertyTester.isMisapplication(selectedElement) |
|
162 |
|| NameEditorMenuPropertyTester.isRelatedConcept(selectedElement); |
|
158 |
if(selection.size()==1){ |
|
159 |
Object selectedElement = selection.getFirstElement(); |
|
160 |
canExecute = |
|
161 |
NameEditorMenuPropertyTester.isSynonym(selectedElement) |
|
162 |
|| NameEditorMenuPropertyTester.isMisapplication(selectedElement) |
|
163 |
|| NameEditorMenuPropertyTester.isRelatedConcept(selectedElement); |
|
164 |
} |
|
163 | 165 |
menuItem.setVisible(canExecute); |
164 | 166 |
return canExecute; |
165 | 167 |
} |
Also available in: Unified diff
ref #7010 Adapt name editor handlers for multiple selection