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