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
.editor
.descriptiveDataSet
.matrix
;
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 import org
.eclipse
.nebula
.widgets
.nattable
.util
.GUIHelper
;
23 import eu
.etaxonomy
.taxeditor
.model
.ImageResources
;
30 public final class CharacterMatrixLabelStyleConfiguration
extends AbstractRegistryConfiguration
{
32 public void configureRegistry(IConfigRegistry configRegistry
) {
33 //different background color styles
34 Style taxonRowStyle
= new Style();
35 taxonRowStyle
.setAttributeValue(
36 CellStyleAttributes
.BACKGROUND_COLOR
,
37 GUIHelper
.COLOR_WIDGET_BACKGROUND
);
38 configRegistry
.registerConfigAttribute(
39 CellConfigAttributes
.CELL_STYLE
,
42 CharacterMatrix
.LABEL_TAXON_ROW
);
44 Style taxonAggregationStyle
= new Style();
45 taxonAggregationStyle
.setAttributeValue(
46 CellStyleAttributes
.BACKGROUND_COLOR
,
47 GUIHelper
.getColor(255, 255, 153));
48 configRegistry
.registerConfigAttribute(
49 CellConfigAttributes
.CELL_STYLE
,
50 taxonAggregationStyle
,
52 CharacterMatrix
.LABEL_TAXON_AGGREGATED_DESCRIPTION
);
54 Style taxonDefaultDescriptionStyle
= new Style();
55 taxonDefaultDescriptionStyle
.setAttributeValue(
56 CellStyleAttributes
.BACKGROUND_COLOR
,
57 GUIHelper
.COLOR_WIDGET_BACKGROUND
);
58 configRegistry
.registerConfigAttribute(
59 CellConfigAttributes
.CELL_STYLE
,
60 taxonDefaultDescriptionStyle
,
62 CharacterMatrix
.LABEL_TAXON_DEFAULT_DESCRIPTION
);
64 Style taxonLiteratureDescriptionStyle
= new Style();
65 taxonLiteratureDescriptionStyle
.setAttributeValue(
66 CellStyleAttributes
.BACKGROUND_COLOR
,
67 GUIHelper
.getColor(231, 231, 231));
68 configRegistry
.registerConfigAttribute(
69 CellConfigAttributes
.CELL_STYLE
,
70 taxonLiteratureDescriptionStyle
,
72 CharacterMatrix
.LABEL_TAXON_LITERATURE_DESCRIPTION
);
74 //cell painter for supplemental data
75 configRegistry
.registerConfigAttribute(
76 CellConfigAttributes
.CELL_PAINTER
,
77 new CellPainterDecorator(
79 CellEdgeEnum
.BOTTOM_RIGHT
,
80 new ImagePainter(GUIHelper
.getImage("plus")),
83 CharacterMatrix
.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA
);
86 * cell painter for description icons
89 configRegistry
.registerConfigAttribute(
90 CellConfigAttributes
.CELL_PAINTER
,
91 new CellPainterDecorator(
94 new ImagePainter(ImageResources
.getImage(ImageResources
.HELP_TOPIC
)),
97 CharacterMatrix
.LABEL_TAXON_LITERATURE_DESCRIPTION_ICON
);
99 configRegistry
.registerConfigAttribute(
100 CellConfigAttributes
.CELL_PAINTER
,
101 new CellPainterDecorator(
104 new ImagePainter(ImageResources
.getImage(ImageResources
.FUNNEL_ICON
)),
107 CharacterMatrix
.LABEL_TAXON_AGGREGATED_DESCRIPTION_ICON
);
109 configRegistry
.registerConfigAttribute(
110 CellConfigAttributes
.CELL_PAINTER
,
111 new CellPainterDecorator(
114 new ImagePainter(ImageResources
.getImage(ImageResources
.VALIDATE_ICON
)),
117 CharacterMatrix
.LABEL_TAXON_DEFAULT_DESCRIPTION_ICON
);