Revision f853dd5b
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingDeleteTaxonNodeHandlerE4.java | ||
---|---|---|
196 | 196 |
@CanExecute |
197 | 197 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){ |
198 | 198 |
boolean canExecute = false; |
199 |
Object selectionElement = selection.getFirstElement(); |
|
200 |
|
|
201 |
canExecute = (selectionElement instanceof TaxonNodeDto) || |
|
202 |
(selectionElement instanceof TaxonNode && ((TaxonNode)selectionElement).getTaxon() == null); |
|
199 |
canExecute = selection.size()==1 |
|
200 |
&& (selection.getFirstElement() instanceof TaxonNodeDto) |
|
201 |
|| |
|
202 |
(selection.getFirstElement() instanceof TaxonNode |
|
203 |
&& ((TaxonNode)selection.getFirstElement()).getTaxon() == null); |
|
203 | 204 |
menuItem.setVisible(canExecute); |
204 | 205 |
return canExecute; |
205 | 206 |
} |
Also available in: Unified diff
ref #7010 Adapt taxon navigator handlers for multiple selection