Revision 8b2d3c40
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/RemoveMergeCandidateHandlerE4.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import javax.inject.Named; |
12 | 12 |
|
13 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
13 | 14 |
import org.eclipse.e4.core.di.annotations.Execute; |
14 | 15 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
16 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
15 | 17 |
import org.eclipse.e4.ui.services.IServiceConstants; |
16 | 18 |
|
17 | 19 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
... | ... | |
33 | 35 |
editor.getEditorInput().removeMergeCandidate(selection); |
34 | 36 |
editor.refresh(); |
35 | 37 |
} |
38 |
|
|
39 |
@CanExecute |
|
40 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)CdmBase selection, |
|
41 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
|
42 |
MHandledMenuItem menuItem) { |
|
43 |
boolean canExecute = false; |
|
44 |
BulkEditorE4 editor = (BulkEditorE4) activePart.getObject(); |
|
45 |
canExecute = editor.getEditorInput().getMergeCandidates().contains(selection); |
|
46 |
menuItem.setVisible(canExecute); |
|
47 |
return canExecute; |
|
48 |
} |
|
36 | 49 |
} |
Also available in: Unified diff
ref #6932 Migrate merge handlers