Revision 53747bc9
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/SetMergeCandidateHandlerE4.java | ||
---|---|---|
29 | 29 |
public class SetMergeCandidateHandlerE4 { |
30 | 30 |
|
31 | 31 |
@Execute |
32 |
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)CdmBase selection,
|
|
32 |
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)Object selection,
|
|
33 | 33 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart) { |
34 | 34 |
BulkEditorE4 editor = (BulkEditorE4) activePart.getObject(); |
35 | 35 |
AbstractBulkEditorInput input = editor.getEditorInput(); |
... | ... | |
37 | 37 |
&& input.getMergeTarget().equals(selection)){ |
38 | 38 |
input.setMergeTarget(null); |
39 | 39 |
} |
40 |
input.addMergeCandidate(selection); |
|
40 |
if (selection instanceof Object[]){ |
|
41 |
for(Object object: (Object[])selection){ |
|
42 |
if (object instanceof CdmBase){ |
|
43 |
input.addMergeCandidate((CdmBase)object); |
|
44 |
} |
|
45 |
} |
|
46 |
}else if (selection instanceof CdmBase){ |
|
47 |
input.addMergeCandidate((CdmBase)selection); |
|
48 |
} |
|
41 | 49 |
editor.refresh(); |
42 | 50 |
} |
43 | 51 |
|
44 | 52 |
@CanExecute |
45 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)CdmBase selection,
|
|
53 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)Object selection,
|
|
46 | 54 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
47 | 55 |
MHandledMenuItem menuItem) { |
48 | 56 |
boolean canExecute = false; |
Also available in: Unified diff
ref #6932: allow multiselection for deduplication