Project

General

Profile

Download (1.51 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.bulkeditor.e4;
10

    
11
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider;
12
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
13
import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator;
14

    
15
import eu.etaxonomy.cdm.model.common.CdmBase;
16
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
17

    
18
/**
19
 * @author pplitzner
20
 * @since Jul 6, 2018
21
 *
22
 */
23
public class BulkEditorConfigLabelAccumulator implements IConfigLabelAccumulator {
24
    private ListDataProvider<CdmBase> dataProvider;
25
    private AbstractBulkEditorInput input;
26

    
27
    public BulkEditorConfigLabelAccumulator(ListDataProvider<CdmBase> dataProvider2,
28
            AbstractBulkEditorInput input2) {
29
        super();
30
        this.dataProvider = dataProvider2;
31
        this.input = input2;
32
    }
33

    
34

    
35
    @Override
36
    public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
37
        CdmBase rowObject = dataProvider.getRowObject(rowPosition);
38
        if(input.getMergeCandidates().contains(rowObject)){
39
            configLabels.addLabel(BulkEditorE4.CANDIDATE_LABEL);
40
        }
41
        else if(input.getMergeTarget()==rowObject){
42
            configLabels.addLabel(BulkEditorE4.TARGET_LABEL);
43
        }
44
    }
45
}
(1-1/8)