Revision f853dd5b
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java | ||
---|---|---|
15 | 15 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
16 | 16 |
import org.eclipse.e4.core.di.annotations.Execute; |
17 | 17 |
import org.eclipse.e4.ui.model.application.MApplication; |
18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
19 | 20 |
import org.eclipse.e4.ui.workbench.modeling.EModelService; |
20 | 21 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
... | ... | |
65 | 66 |
} |
66 | 67 |
|
67 | 68 |
@CanExecute |
68 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection){ |
|
69 |
return selection!=null && !selection.isEmpty(); |
|
69 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, |
|
70 |
MHandledMenuItem menuItem){ |
|
71 |
boolean canExecute = false; |
|
72 |
canExecute = selection!=null && selection.size()==1; |
|
73 |
menuItem.setVisible(canExecute); |
|
74 |
return canExecute; |
|
70 | 75 |
} |
71 | 76 |
} |
Also available in: Unified diff
ref #7010 Adapt taxon navigator handlers for multiple selection