Revision d8bd1bdc
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/CharacterMatrix.java | ||
---|---|---|
91 | 91 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.categorical.CategoricalDataDisplayConverter; |
92 | 92 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.quantitative.QuantitativeDataCellEditor; |
93 | 93 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.quantitative.QuantitativeDataDisplayConverter; |
94 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.supplementalInfo.SupplementalInfoDisplayConverter; |
|
94 | 95 |
import eu.etaxonomy.taxeditor.model.IDirtyMarkable; |
95 | 96 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
96 | 97 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
... | ... | |
167 | 168 |
* BODY layer |
168 | 169 |
*/ |
169 | 170 |
DataLayer bodyDataLayer = new DataLayer(bodyDataProvider); |
171 |
|
|
172 |
//register labels for columns |
|
170 | 173 |
final ColumnOverrideLabelAccumulator columnLabelAccumulator =new ColumnOverrideLabelAccumulator(bodyDataLayer); |
171 | 174 |
bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator); |
172 | 175 |
propertyToLabelMap.put(TAXON_COLUMN, "Taxon"); |
176 |
columnLabelAccumulator.registerColumnOverrides(0, TAXON_COLUMN); |
|
173 | 177 |
propertyToLabelMap.put(COLLECTOR_COLUMN, "Collector + No"); |
178 |
columnLabelAccumulator.registerColumnOverrides(1, COLLECTOR_COLUMN); |
|
174 | 179 |
propertyToLabelMap.put(IDENTIFIER_COLUMN, "Identifier"); |
180 |
columnLabelAccumulator.registerColumnOverrides(2, IDENTIFIER_COLUMN); |
|
175 | 181 |
propertyToLabelMap.put(COUNTRY_COLUMN, "Country"); |
182 |
columnLabelAccumulator.registerColumnOverrides(3, COUNTRY_COLUMN); |
|
176 | 183 |
for(int i=0;i<features.size();i++){ |
177 | 184 |
Feature feature = features.get(i); |
178 | 185 |
initLabels(columnLabelAccumulator, i, feature); |
179 | 186 |
} |
187 |
|
|
180 | 188 |
GlazedListsEventLayer<RowWrapper> eventLayer = new GlazedListsEventLayer<>(bodyDataLayer, sortedList); |
181 | 189 |
|
182 | 190 |
RowReorderLayer rowReorderLayer = new RowReorderLayer(eventLayer); |
... | ... | |
241 | 249 |
natTable.addConfiguration(new SingleClickSortConfiguration()); |
242 | 250 |
|
243 | 251 |
|
244 |
// add custom configuration for data conversion and add column labels for each feature
|
|
252 |
// add custom configuration for data conversion and add column labels |
|
245 | 253 |
viewportLayer.addConfiguration(new AbstractRegistryConfiguration() { |
246 | 254 |
@Override |
247 | 255 |
public void configureRegistry(IConfigRegistry configRegistry) { |
256 |
//add display converter for string representation |
|
257 |
configRegistry.registerConfigAttribute( |
|
258 |
CellConfigAttributes.DISPLAY_CONVERTER, |
|
259 |
new SupplementalInfoDisplayConverter(), |
|
260 |
DisplayMode.NORMAL, |
|
261 |
TAXON_COLUMN); |
|
262 |
configRegistry.registerConfigAttribute( |
|
263 |
CellConfigAttributes.DISPLAY_CONVERTER, |
|
264 |
new SupplementalInfoDisplayConverter(), |
|
265 |
DisplayMode.NORMAL, |
|
266 |
COLLECTOR_COLUMN); |
|
267 |
configRegistry.registerConfigAttribute( |
|
268 |
CellConfigAttributes.DISPLAY_CONVERTER, |
|
269 |
new SupplementalInfoDisplayConverter(), |
|
270 |
DisplayMode.NORMAL, |
|
271 |
IDENTIFIER_COLUMN); |
|
272 |
configRegistry.registerConfigAttribute( |
|
273 |
CellConfigAttributes.DISPLAY_CONVERTER, |
|
274 |
new SupplementalInfoDisplayConverter(), |
|
275 |
DisplayMode.NORMAL, |
|
276 |
COUNTRY_COLUMN); |
|
248 | 277 |
features.forEach(feature->registerColumnConfiguration(feature, configRegistry)); |
249 | 278 |
} |
250 | 279 |
|
Also available in: Unified diff
ref #7095 Add display converter for supplemental info