Revision bce766a1
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorLabelProvider.java | ||
---|---|---|
18 | 18 |
import org.eclipse.jface.viewers.LabelProvider; |
19 | 19 |
import org.eclipse.swt.graphics.Image; |
20 | 20 |
|
21 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
|
21 | 22 |
import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin; |
22 | 23 |
import eu.etaxonomy.taxeditor.model.ImageResources; |
23 | 24 |
|
... | ... | |
28 | 29 |
*/ |
29 | 30 |
public class BulkEditorLabelProvider extends LabelProvider { |
30 | 31 |
|
32 |
private BulkEditorE4 editor; |
|
33 |
|
|
34 |
public BulkEditorLabelProvider(BulkEditorE4 editor) { |
|
35 |
super(); |
|
36 |
this.editor = editor; |
|
37 |
} |
|
38 |
|
|
31 | 39 |
/** |
32 | 40 |
* {@inheritDoc} |
33 | 41 |
*/ |
34 | 42 |
@Override |
35 | 43 |
public Image getImage(Object element) { |
36 |
AnnotatedTableItem item = (AnnotatedTableItem)element; |
|
44 |
AbstractBulkEditorInput input = editor.getEditorInput(); |
|
45 |
|
|
37 | 46 |
try { |
38 |
if(item.isMergeCandidate()){
|
|
47 |
if(input.getMergeCandidates().contains(element)){
|
|
39 | 48 |
IPath path = new Path("icons/merge_candidate.gif"); //$NON-NLS-1$ |
40 | 49 |
URL url = FileLocator.find(TaxeditorBulkeditorPlugin.getDefault().getBundle(), path, null); |
41 | 50 |
return ImageResources.getImage(url.toURI()); |
42 | 51 |
} |
43 |
else if(item.isMergeTarget()){
|
|
52 |
else if(input.getMergeTarget()!=null && input.getMergeTarget().equals(element)){
|
|
44 | 53 |
IPath path = new Path("icons/merge_target.gif"); //$NON-NLS-1$ |
45 | 54 |
URL url = FileLocator.find(TaxeditorBulkeditorPlugin.getDefault().getBundle(), path, null); |
46 | 55 |
return ImageResources.getImage(url.toURI()); |
Also available in: Unified diff
ref #6932 Refactor merge annotating