Revision 369d3230
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingChangeAcceptedTaxonToSynonymHandlerE4.java | ||
---|---|---|
7 | 7 |
import java.util.List; |
8 | 8 |
import java.util.UUID; |
9 | 9 |
|
10 |
import javax.inject.Named; |
|
11 |
|
|
10 | 12 |
import org.eclipse.core.commands.operations.AbstractOperation; |
11 | 13 |
import org.eclipse.core.runtime.IStatus; |
12 | 14 |
import org.eclipse.core.runtime.Status; |
15 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
13 | 16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
14 | 17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
15 | 19 |
import org.eclipse.jface.viewers.TreeSelection; |
16 | 20 |
import org.eclipse.swt.widgets.Shell; |
17 | 21 |
|
... | ... | |
113 | 117 |
return rcattso; |
114 | 118 |
} |
115 | 119 |
|
120 |
@CanExecute |
|
121 |
private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){ |
|
122 |
boolean canExecute = false; |
|
123 |
menuItem.setVisible(canExecute); |
|
124 |
canExecute = selection.getFirstElement() instanceof TaxonNode; |
|
125 |
System.out.println(canExecute); |
|
126 |
return canExecute; |
|
127 |
} |
|
128 |
|
|
116 | 129 |
@Override |
117 | 130 |
public void onComplete() { |
118 | 131 |
} |
Also available in: Unified diff
ref #6909 Implement canExecute() for remoting handler