Project

General

Profile

« Previous | Next » 

Revision 487ef756

Added by Patrick Plitzner over 5 years ago

ref #7674 Add icon for different description types

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java
78 78
import org.eclipse.nebula.widgets.nattable.tree.TreeLayer;
79 79
import org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry;
80 80
import org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher;
81
import org.eclipse.nebula.widgets.nattable.ui.menu.DebugMenuConfiguration;
82 81
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuAction;
83 82
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder;
84 83
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
......
131 130

  
132 131
    static final String LABEL_TAXON_ROW = "TAXON_ROW"; //$NON-NLS-1$
133 132
    static final String LABEL_TAXON_AGGREGATED_DESCRIPTION = "TAXON_AGGREGATED_DESCRIPTION"; //$NON-NLS-1$
133
    static final String LABEL_TAXON_AGGREGATED_DESCRIPTION_ICON = "TAXON_AGGREGATED_DESCRIPTION_ICON"; //$NON-NLS-1$
134 134
    static final String LABEL_TAXON_DEFAULT_DESCRIPTION = "TAXON_DEFAULT_DESCRIPTION"; //$NON-NLS-1$
135
    static final String LABEL_TAXON_DEFAULT_DESCRIPTION_ICON = "TAXON_DEFAULT_DESCRIPTION_ICON"; //$NON-NLS-1$
135 136
    static final String LABEL_TAXON_LITERATURE_DESCRIPTION = "TAXON_LITERATURE_DESCRIPTION"; //$NON-NLS-1$
137
    static final String LABEL_TAXON_LITERATURE_DESCRIPTION_ICON = "TAXON_LITERATURE_DESCRIPTION_ICON"; //$NON-NLS-1$
136 138
    static final String LABEL_TAXON_DESCRIPTION = "LABEL_TAXON_DESCRIPTION"; //$NON-NLS-1$
137 139
    static final String LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA = "LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA"; //$NON-NLS-1$
138 140

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixConfigLabelAccumulator.java
47 47
            if(MatrixUtility.isAggregatedTaxonDescription(taxonRowWrapper)){
48 48
                configLabels.addLabel(CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION);
49 49
                isEditable = false;
50
                if(columnPosition==0){
51
                    configLabels.addLabel(CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION_ICON);
52
                }
50 53
            }
51 54
            else if(MatrixUtility.isDefaultTaxonDescription(taxonRowWrapper)){
52 55
                configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DEFAULT_DESCRIPTION);
56
                if(columnPosition==0){
57
                    configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DEFAULT_DESCRIPTION_ICON);
58
                }
53 59
            }
54 60
            else if(MatrixUtility.isLiteratureTaxonDescription(taxonRowWrapper)){
55 61
                configLabels.addLabel(CharacterMatrix.LABEL_TAXON_LITERATURE_DESCRIPTION);
62
                if(columnPosition==0){
63
                    configLabels.addLabel(CharacterMatrix.LABEL_TAXON_LITERATURE_DESCRIPTION_ICON);
64
                }
56 65
            }
57 66
            //check for supplemental data
58 67
            if(!taxonRowWrapper.getDescription().getSources().isEmpty() && columnPosition==0){
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixLabelStyleConfiguration.java
20 20
import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
21 21
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
22 22

  
23
import eu.etaxonomy.taxeditor.model.ImageResources;
24

  
23 25
/**
24 26
 * @author pplitzner
25 27
 * @since Jul 6, 2018
......
80 82
                DisplayMode.NORMAL,
81 83
                CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
82 84

  
85
        /*
86
         * cell painter for description icons
87
         */
88
        //literature
89
        configRegistry.registerConfigAttribute(
90
                CellConfigAttributes.CELL_PAINTER,
91
                new CellPainterDecorator(
92
                        new TextPainter(),
93
                        CellEdgeEnum.LEFT,
94
                        new ImagePainter(ImageResources.getImage(ImageResources.HELP_TOPIC)),
95
                        true),
96
                DisplayMode.NORMAL,
97
                CharacterMatrix.LABEL_TAXON_LITERATURE_DESCRIPTION_ICON);
98
        //aggregation
99
        configRegistry.registerConfigAttribute(
100
                CellConfigAttributes.CELL_PAINTER,
101
                new CellPainterDecorator(
102
                        new TextPainter(),
103
                        CellEdgeEnum.LEFT,
104
                        new ImagePainter(ImageResources.getImage(ImageResources.FUNNEL_ICON)),
105
                        true),
106
                DisplayMode.NORMAL,
107
                CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION_ICON);
108
        //default
109
        configRegistry.registerConfigAttribute(
110
                CellConfigAttributes.CELL_PAINTER,
111
                new CellPainterDecorator(
112
                        new TextPainter(),
113
                        CellEdgeEnum.LEFT,
114
                        new ImagePainter(ImageResources.getImage(ImageResources.VALIDATE_ICON)),
115
                        true),
116
                DisplayMode.NORMAL,
117
                CharacterMatrix.LABEL_TAXON_DEFAULT_DESCRIPTION_ICON);
118

  
83 119

  
84 120
    }
85 121
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
182 182
    public static final String HIERARCHICAL = "hierarchical";
183 183

  
184 184
    public static final String LIGHT_BULB = "light_bulb";
185
    public static final String HELP_TOPIC = "help_icon";
186
    public static final String VALIDATE_ICON = "VALIDATE_ICON";
187
    public static final String FUNNEL_ICON = "FUNNEL_ICON";
188
    public static final String FUNNEL_ICON_EXCLAMATION = "FUNNEL_ICON_EXCLAMATION";
185 189

  
186 190

  
187 191
	/***************************************************************************
......
438 442
		        "hierarchical.gif");
439 443
		registerImage(registry, LIGHT_BULB,
440 444
		        "smartmode_co.gif");
445
		registerImage(registry, HELP_TOPIC,
446
		        "help_topic.gif");
447
		registerImage(registry, VALIDATE_ICON,
448
		        "validate.gif");
449
		registerImage(registry, FUNNEL_ICON,
450
		        "funnel-icon.png");
451
		registerImage(registry, FUNNEL_ICON_EXCLAMATION,
452
		        "funnel-exclamation-icon.png");
441 453

  
442 454
	}
443 455

  

Also available in: Unified diff