2 * Copyright (C) 2018 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.bulkeditor
.e4
;
11 import org
.eclipse
.nebula
.widgets
.nattable
.data
.ListDataProvider
;
12 import org
.eclipse
.nebula
.widgets
.nattable
.grid
.data
.DefaultColumnHeaderDataProvider
;
13 import org
.eclipse
.nebula
.widgets
.nattable
.layer
.LabelStack
;
14 import org
.eclipse
.nebula
.widgets
.nattable
.layer
.cell
.IConfigLabelAccumulator
;
16 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
17 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.AbstractBulkEditorInput
;
24 public class BulkEditorConfigLabelAccumulator
implements IConfigLabelAccumulator
{
26 private ListDataProvider
<CdmBase
> dataProvider
;
27 private AbstractBulkEditorInput input
;
28 private DefaultColumnHeaderDataProvider colHeaderDataProvider
;
30 public BulkEditorConfigLabelAccumulator(ListDataProvider
<CdmBase
> dataProvider
,
31 DefaultColumnHeaderDataProvider colHeaderDataProvider
, AbstractBulkEditorInput input
) {
32 this.dataProvider
= dataProvider
;
33 this.colHeaderDataProvider
= colHeaderDataProvider
;
39 public void accumulateConfigLabels(LabelStack configLabels
, int columnPosition
, int rowPosition
) {
43 if(input
.isBooleanProperty(colHeaderDataProvider
.getColumnHeaderLabel(columnPosition
))){
44 configLabels
.addLabel(BulkEditorConfigLabelAccumulatorHeader
.BOOLEAN_COLUMN
);
46 CdmBase rowObject
= dataProvider
.getRowObject(rowPosition
);
47 if(input
.getMergeCandidates().contains(rowObject
)){
48 configLabels
.addLabel(BulkEditorE4Composite
.LABEL_CANDIDATE
);
49 if(columnPosition
==0){
50 configLabels
.addLabel(BulkEditorE4Composite
.LABEL_CANDIDATE_ICON
);
53 else if(input
.getMergeTarget()==rowObject
){
54 configLabels
.addLabel(BulkEditorE4Composite
.LABEL_TARGET
);
55 if(columnPosition
==0){
56 configLabels
.addLabel(BulkEditorE4Composite
.LABEL_TARGET_ICON
);