Project

General

Profile

« Previous | Next » 

Revision 7c3f1a46

Added by Patrick Plitzner almost 6 years ago

ref #7575 Add toggle button for aggregated/exact quant data editing

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CellEditorDataConversionConfiguration.java
24 24
import eu.etaxonomy.cdm.model.description.Feature;
25 25
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical.CategoricalDataCellEditor;
26 26
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical.CategoricalDataDisplayConverter;
27
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.quantitative.QuantitativeDataCellEditor;
27 28
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.quantitative.QuantitativeDataDialogEditor;
28 29
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.quantitative.QuantitativeDataEditModeDisplayConverter;
29 30
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.quantitative.QuantitativeDataNormalModeDisplayConverter;
......
70 71

  
71 72
        //---register cell editors---
72 73

  
73
        //categorical cell editor
74
        /**
75
         * categorical cell editor
76
         */
74 77
        //make cell editable
75 78
        configRegistry.registerConfigAttribute(
76 79
                EditConfigAttributes.CELL_EDITABLE_RULE,
......
87 90
                );
88 91

  
89 92

  
90
        //quantitative cell editor
93
        /**
94
         * quantitative cell editor
95
         */
91 96
        //make cell editable
92 97
        configRegistry.registerConfigAttribute(
93 98
                EditConfigAttributes.CELL_EDITABLE_RULE,
......
95 100
                DisplayMode.EDIT,
96 101
                CharacterMatrixConfigLabelAccumulator.QUANTITATIVE
97 102
                );
98
      //add display converter for string representation
103
        //add display converter for string representation
99 104
        configRegistry.registerConfigAttribute(
100 105
                CellConfigAttributes.DISPLAY_CONVERTER,
101 106
                new QuantitativeDataEditModeDisplayConverter(),
......
106 111
                new QuantitativeDataNormalModeDisplayConverter(),
107 112
                DisplayMode.NORMAL,
108 113
                CharacterMatrixConfigLabelAccumulator.QUANTITATIVE);
109
        //Open cell editorin dialog
114

  
115
        /**
116
         * exact value editor
117
         */
118
        //Open cell editor in dialog
110 119
        configRegistry.registerConfigAttribute(
111 120
                EditConfigAttributes.OPEN_IN_DIALOG,
112 121
                Boolean.TRUE,
113 122
                DisplayMode.EDIT,
114
                CharacterMatrixConfigLabelAccumulator.QUANTITATIVE);
123
                CharacterMatrixConfigLabelAccumulator.QUANT_EXACT);
115 124
        //register quantitative editor
116 125
        configRegistry.registerConfigAttribute(
117 126
                EditConfigAttributes.CELL_EDITOR,
118 127
                new QuantitativeDataDialogEditor(matrix),
119 128
                DisplayMode.EDIT,
120
                CharacterMatrixConfigLabelAccumulator.QUANTITATIVE);
129
                CharacterMatrixConfigLabelAccumulator.QUANT_EXACT);
121 130
        // configure custom dialog settings
122 131
        Map<String, Object> editDialogSettings = new HashMap<>();
123 132
        editDialogSettings.put(ICellEditDialog.DIALOG_SHELL_TITLE, "Quantitative Data");
......
136 145
                EditConfigAttributes.EDIT_DIALOG_SETTINGS,
137 146
                editDialogSettings,
138 147
                DisplayMode.EDIT,
139
                CharacterMatrixConfigLabelAccumulator.QUANTITATIVE);
148
                CharacterMatrixConfigLabelAccumulator.QUANT_EXACT);
140 149

  
141 150

  
142 151
        //TODO: this for loop can maybe be avoided
......
144 153
    }
145 154

  
146 155
    private void registerColumnConfiguration(Feature feature, IConfigRegistry configRegistry) {
147
        if(feature.isSupportsCategoricalData()){
156
        if(feature.isSupportsQuantitativeData()){
157
        /**
158
         * aggregated value editor
159
         */
160
        configRegistry.registerConfigAttribute(
161
                EditConfigAttributes.CELL_EDITOR,
162
                new QuantitativeDataCellEditor(feature, matrix),
163
                DisplayMode.EDIT,
164
                CharacterMatrixConfigLabelAccumulator.QUANT_AGGREGATED);
165
        }
166
        else if(feature.isSupportsCategoricalData()){
148 167
            //add combo box cell editor
149 168
            //register editor
150 169
            configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR,

Also available in: Unified diff