Revision c3bb7840
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/SetSecReferenceForSubtreeHandlerE4.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler; |
10 | 10 |
|
11 |
import javax.inject.Named; |
|
12 |
|
|
11 | 13 |
import org.eclipse.core.commands.operations.AbstractOperation; |
12 | 14 |
import org.eclipse.core.runtime.IStatus; |
13 | 15 |
import org.eclipse.core.runtime.Status; |
16 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
14 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
15 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
16 | 20 |
import org.eclipse.jface.viewers.TreeSelection; |
17 | 21 |
import org.eclipse.jface.window.Window; |
18 | 22 |
import org.eclipse.jface.wizard.WizardDialog; |
... | ... | |
91 | 95 |
}else{ |
92 | 96 |
return Status.CANCEL_STATUS; |
93 | 97 |
} |
98 |
} |
|
94 | 99 |
|
100 |
@CanExecute |
|
101 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection){ |
|
102 |
return selection.getFirstElement() instanceof ITaxonTreeNode; |
|
95 | 103 |
} |
96 | 104 |
|
97 | 105 |
@Override |
Also available in: Unified diff
ref #6909 Implement menu item/handler visibility