Project

General

Profile

Download (2.77 KB) Statistics
| Branch: | Tag: | Revision:
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.editor.descriptiveDataSet.matrix;
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.style.CellStyleAttributes;
15
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
16
import org.eclipse.nebula.widgets.nattable.style.Style;
17
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
18

    
19
/**
20
 * @author pplitzner
21
 * @since Jul 6, 2018
22
 *
23
 */
24
public final class CharacterMatrixLabelStyleConfiguration extends AbstractRegistryConfiguration {
25
    @Override
26
    public void configureRegistry(IConfigRegistry configRegistry) {
27
        Style taxonRowStyle = new Style();
28
        taxonRowStyle.setAttributeValue(
29
                CellStyleAttributes.BACKGROUND_COLOR,
30
                GUIHelper.COLOR_WIDGET_BACKGROUND);
31
        configRegistry.registerConfigAttribute(
32
                CellConfigAttributes.CELL_STYLE,
33
                taxonRowStyle,
34
                DisplayMode.NORMAL,
35
                CharacterMatrix.LABEL_TAXON_ROW);
36

    
37
        Style taxonAggregationStyle = new Style();
38
        taxonAggregationStyle.setAttributeValue(
39
                CellStyleAttributes.BACKGROUND_COLOR,
40
                GUIHelper.getColor(255, 255, 153));
41
        configRegistry.registerConfigAttribute(
42
                CellConfigAttributes.CELL_STYLE,
43
                taxonAggregationStyle,
44
                DisplayMode.NORMAL,
45
                CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION);
46

    
47
        Style taxonDefaultDescriptionStyle = new Style();
48
        taxonDefaultDescriptionStyle.setAttributeValue(
49
                CellStyleAttributes.BACKGROUND_COLOR,
50
                GUIHelper.COLOR_WIDGET_BACKGROUND);
51
        configRegistry.registerConfigAttribute(
52
                CellConfigAttributes.CELL_STYLE,
53
                taxonDefaultDescriptionStyle,
54
                DisplayMode.NORMAL,
55
                CharacterMatrix.LABEL_TAXON_DEFAULT_DESCRIPTION);
56

    
57
        Style taxonLiteratureDescriptionStyle = new Style();
58
        taxonLiteratureDescriptionStyle.setAttributeValue(
59
                CellStyleAttributes.BACKGROUND_COLOR,
60
                GUIHelper.getColor(231, 231, 231));
61
        configRegistry.registerConfigAttribute(
62
                CellConfigAttributes.CELL_STYLE,
63
                taxonLiteratureDescriptionStyle,
64
                DisplayMode.NORMAL,
65
                CharacterMatrix.LABEL_TAXON_LITERATURE_DESCRIPTION);
66

    
67
    }
68
}
(10-10/19)