Revision e82f01c0
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/MoveTaxonHandlerE4.java | ||
---|---|---|
20 | 20 |
|
21 | 21 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
22 | 22 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
23 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
23 | 24 |
import org.eclipse.e4.ui.services.IServiceConstants; |
24 | 25 |
import org.eclipse.jface.dialogs.MessageDialog; |
25 | 26 |
import org.eclipse.jface.viewers.TreeSelection; |
... | ... | |
101 | 102 |
} |
102 | 103 |
|
103 | 104 |
@CanExecute |
104 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection){ |
|
105 |
return selection.getFirstElement() instanceof TaxonNode; |
|
105 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){ |
|
106 |
boolean canExecute = false; |
|
107 |
menuItem.setVisible(canExecute); |
|
108 |
canExecute = selection.getFirstElement() instanceof TaxonNode; |
|
109 |
return canExecute; |
|
106 | 110 |
} |
107 | 111 |
|
108 | 112 |
/** {@inheritDoc} */ |
Also available in: Unified diff
ref #6909 Hide disabled menu items