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.config.AbstractRegistryConfiguration;
|
12
|
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
|
13
|
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
|
14
|
import org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter;
|
15
|
import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
|
16
|
import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.CellPainterDecorator;
|
17
|
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
18
|
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
|
19
|
import org.eclipse.nebula.widgets.nattable.style.Style;
|
20
|
import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
|
21
|
|
22
|
import eu.etaxonomy.taxeditor.model.ColorResources;
|
23
|
import eu.etaxonomy.taxeditor.model.ImageResources;
|
24
|
import eu.etaxonomy.taxeditor.preference.Resources;
|
25
|
|
26
|
/**
|
27
|
* @author pplitzner
|
28
|
* @since Jul 6, 2018
|
29
|
*
|
30
|
*/
|
31
|
public final class BulkEditorLabelStyleConfiguration extends AbstractRegistryConfiguration {
|
32
|
@Override
|
33
|
public void configureRegistry(IConfigRegistry configRegistry) {
|
34
|
//deduplication candidate style
|
35
|
Style candidateCellStyle = new Style();
|
36
|
candidateCellStyle.setAttributeValue(
|
37
|
CellStyleAttributes.BACKGROUND_COLOR,
|
38
|
ColorResources.getColor(Resources.COLOR_BULK_EDITOR_CANDIDATE));
|
39
|
configRegistry.registerConfigAttribute(
|
40
|
CellConfigAttributes.CELL_STYLE,
|
41
|
candidateCellStyle,
|
42
|
DisplayMode.NORMAL,
|
43
|
BulkEditorE4Composite.LABEL_CANDIDATE);
|
44
|
configRegistry.registerConfigAttribute(
|
45
|
CellConfigAttributes.CELL_PAINTER,
|
46
|
new CellPainterDecorator(
|
47
|
new TextPainter(),
|
48
|
CellEdgeEnum.BOTTOM_RIGHT,
|
49
|
new ImagePainter(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON)),
|
50
|
false),
|
51
|
DisplayMode.NORMAL,
|
52
|
BulkEditorE4Composite.LABEL_CANDIDATE_ICON);
|
53
|
|
54
|
//deduplication target style
|
55
|
Style targetCellStyle = new Style();
|
56
|
targetCellStyle.setAttributeValue(
|
57
|
CellStyleAttributes.BACKGROUND_COLOR,
|
58
|
ColorResources.getColor(Resources.COLOR_BULK_EDITOR_TARGET));
|
59
|
configRegistry.registerConfigAttribute(
|
60
|
CellConfigAttributes.CELL_STYLE, targetCellStyle,
|
61
|
DisplayMode.NORMAL, BulkEditorE4Composite.LABEL_TARGET);
|
62
|
configRegistry.registerConfigAttribute(
|
63
|
CellConfigAttributes.CELL_PAINTER,
|
64
|
new CellPainterDecorator(
|
65
|
new TextPainter(),
|
66
|
CellEdgeEnum.BOTTOM_RIGHT,
|
67
|
new ImagePainter(ImageResources.getImage(ImageResources.IMPORT)),
|
68
|
false),
|
69
|
DisplayMode.NORMAL,
|
70
|
BulkEditorE4Composite.LABEL_TARGET_ICON);
|
71
|
|
72
|
}
|
73
|
}
|