/**
 * 
 */
package org.corpus_tools.atomic.ui.tagset.editor.configuration;

import org.corpus_tools.atomic.tagset.TagsetValue;
import org.eclipse.nebula.widgets.nattable.data.IRowDataProvider;
import org.eclipse.nebula.widgets.nattable.layer.ILayer;
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator;

/**
 * // TODO Add description
 *
 * @author Stephan Druskat <[mail@sdruskat.net](mailto:mail@sdruskat.net)>
 * 
 */
public class CustomLabelAccumulator extends ColumnOverrideLabelAccumulator {

	private IRowDataProvider<TagsetValue> bodyRowDataProvider;

	public CustomLabelAccumulator(ILayer layer, IRowDataProvider<TagsetValue> bodyRowDataProvider) {
		super(layer);
		this.bodyRowDataProvider = bodyRowDataProvider;
	}
	
	@Override
	public void accumulateConfigLabels(
			LabelStack configLabels, 
			int columnPosition, 
			int rowPosition) {
		super.accumulateConfigLabels(configLabels, columnPosition, rowPosition);

		//get the row object out of the dataprovider
		TagsetValue rowObject = this.bodyRowDataProvider
					.getRowObject(rowPosition);

		//in column 3 and 4 there are the values that 
		//are cross validated
		if (columnPosition == 4) {
			if (!TagsetValue.isValidValue(rowObject)) {
				configLabels.addLabel("INVALID");
			}
		}
	}

}

@@ -1020,17 +1020,18 @@
 );%0A%0A%09%09//
-g
+ G
 et the r
@@ -1044,23 +1044,17 @@
 ect 
-out of the
+via
  data
+ 
 prov
@@ -1112,14 +1112,8 @@
 ider
-%0A%09%09%09%09%09
 .get
@@ -1145,76 +1145,45 @@
 %09%09//
-in column 3 and 4 there are the values that %0A%09%09//are cross
+ Check if annotation value
  valid
-ated
+ifies
 %0A%09%09i

Fix comments