import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
+import org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter;
+import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
+import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.CellPainterDecorator;
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
import org.eclipse.nebula.widgets.nattable.style.Style;
+import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
import eu.etaxonomy.taxeditor.model.ColorResources;
+import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.preference.Resources;
/**
public final class BulkEditorLabelStyleConfiguration extends AbstractRegistryConfiguration {
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
- Style cellStyle = new Style();
- cellStyle.setAttributeValue(
+ //deduplication candidate style
+ Style candidateCellStyle = new Style();
+ candidateCellStyle.setAttributeValue(
CellStyleAttributes.BACKGROUND_COLOR,
ColorResources.getColor(Resources.COLOR_BULK_EDITOR_CANDIDATE));
configRegistry.registerConfigAttribute(
- CellConfigAttributes.CELL_STYLE, cellStyle,
- DisplayMode.NORMAL, BulkEditorE4Composite.CANDIDATE_LABEL);
+ CellConfigAttributes.CELL_STYLE,
+ candidateCellStyle,
+ DisplayMode.NORMAL,
+ BulkEditorE4Composite.LABEL_CANDIDATE);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_PAINTER,
+ new CellPainterDecorator(
+ new TextPainter(),
+ CellEdgeEnum.BOTTOM_RIGHT,
+ new ImagePainter(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON)),
+ false),
+ DisplayMode.NORMAL,
+ BulkEditorE4Composite.LABEL_CANDIDATE_ICON);
- cellStyle = new Style();
- cellStyle.setAttributeValue(
+ //deduplication target style
+ Style targetCellStyle = new Style();
+ targetCellStyle.setAttributeValue(
CellStyleAttributes.BACKGROUND_COLOR,
ColorResources.getColor(Resources.COLOR_BULK_EDITOR_TARGET));
configRegistry.registerConfigAttribute(
- CellConfigAttributes.CELL_STYLE, cellStyle,
- DisplayMode.NORMAL, BulkEditorE4Composite.TARGET_LABEL);
+ CellConfigAttributes.CELL_STYLE, targetCellStyle,
+ DisplayMode.NORMAL, BulkEditorE4Composite.LABEL_TARGET);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_PAINTER,
+ new CellPainterDecorator(
+ new TextPainter(),
+ CellEdgeEnum.BOTTOM_RIGHT,
+ new ImagePainter(ImageResources.getImage(ImageResources.IMPORT)),
+ false),
+ DisplayMode.NORMAL,
+ BulkEditorE4Composite.LABEL_TARGET_ICON);
}
}
\ No newline at end of file
int row = this.natTable.getRowPositionByY(event.y);
LabelStack configLabels = natTable.getConfigLabelsByPosition(col, row);
- if(configLabels.hasLabel(BulkEditorE4Composite.TARGET_LABEL)){
+ if(configLabels.hasLabel(BulkEditorE4Composite.LABEL_TARGET)){
return Messages.BulkEditorTooltip_TARGET;
}
- else if(configLabels.hasLabel(BulkEditorE4Composite.CANDIDATE_LABEL)){
+ else if(configLabels.hasLabel(BulkEditorE4Composite.LABEL_CANDIDATE)){
return Messages.BulkEditorTooltip_CANDIDATE;
}
return ""; //$NON-NLS-1$
int row = this.natTable.getRowPositionByY(event.y);
LabelStack configLabels = natTable.getConfigLabelsByPosition(col, row);
- if(configLabels.hasLabel(BulkEditorE4Composite.CANDIDATE_LABEL)
- || configLabels.hasLabel(BulkEditorE4Composite.TARGET_LABEL)){
+ if(configLabels.hasLabel(BulkEditorE4Composite.LABEL_CANDIDATE)
+ || configLabels.hasLabel(BulkEditorE4Composite.LABEL_TARGET)){
return true;
}
return false;