Revision b11b49ce
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ShowPherogramHandler.java | ||
---|---|---|
5 | 5 |
|
6 | 6 |
import javax.inject.Named; |
7 | 7 |
|
8 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
8 | 9 |
import org.eclipse.e4.core.di.annotations.Execute; |
9 | 10 |
import org.eclipse.e4.core.di.annotations.Optional; |
11 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
10 | 12 |
import org.eclipse.e4.ui.services.IServiceConstants; |
11 | 13 |
import org.eclipse.jface.viewers.TreeNode; |
12 | 14 |
import org.eclipse.ui.PartInitException; |
... | ... | |
59 | 61 |
} |
60 | 62 |
return null; |
61 | 63 |
} |
64 |
|
|
65 |
@CanExecute |
|
66 |
public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode, MHandledMenuItem menuItem) { |
|
67 |
boolean canExecute = false; |
|
68 |
if(selectedTreeNode!=null){ |
|
69 |
Object value = selectedTreeNode.getValue(); |
|
70 |
canExecute = value instanceof SingleRead; |
|
71 |
} |
|
72 |
menuItem.setVisible(canExecute); |
|
73 |
return canExecute; |
|
74 |
} |
|
62 | 75 |
} |
Also available in: Unified diff
ref #6597 Re-enable molecular handlers