ref #7095 minor refactoring
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / workingSet / matrix / CharacterMatrix.java
index a2023922cdb4974d5229b3e73624906287887299..e2e5ed2494dcc6baef2cf23833cac7313b49f947 100644 (file)
@@ -169,9 +169,13 @@ public class CharacterMatrix implements IE4SavablePart, IPartContentHasDetails,
         DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
         final ColumnOverrideLabelAccumulator columnLabelAccumulator =new ColumnOverrideLabelAccumulator(bodyDataLayer);
         bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
+        propertyToLabelMap.put(TAXON_COLUMN, "Taxon");
+        propertyToLabelMap.put(COLLECTOR_COLUMN, "Collector + No");
+        propertyToLabelMap.put(IDENTIFIER_COLUMN, "Identifier");
+        propertyToLabelMap.put(COUNTRY_COLUMN, "Country");
         for(int i=0;i<features.size();i++){
             Feature feature = features.get(i);
-            initLabels(features, columnLabelAccumulator, i, feature);
+            initLabels(columnLabelAccumulator, i, feature);
         }
         GlazedListsEventLayer<SpecimenDescription> eventLayer = new GlazedListsEventLayer<>(bodyDataLayer, sortedList);
 
@@ -285,15 +289,10 @@ public class CharacterMatrix implements IE4SavablePart, IPartContentHasDetails,
         parent.layout();
     }
 
-    private void initLabels(List<Feature> features, final ColumnOverrideLabelAccumulator columnLabelAccumulator,
+    private void initLabels(final ColumnOverrideLabelAccumulator columnLabelAccumulator,
             int index, Feature feature) {
 
-        propertyToLabelMap.put(TAXON_COLUMN, "Taxon");
-        propertyToLabelMap.put(COLLECTOR_COLUMN, "Collector + No");
-        propertyToLabelMap.put(IDENTIFIER_COLUMN, "Identifier");
-        propertyToLabelMap.put(COUNTRY_COLUMN, "Country");
-
-        columnLabelAccumulator.registerColumnOverrides(index+LEADING_COLUMN_COUNT, getProperty(features.get(index)));
+        columnLabelAccumulator.registerColumnOverrides(index+LEADING_COLUMN_COUNT, getProperty(feature));
         indexToFeatureMap.put(index+LEADING_COLUMN_COUNT, feature);
 
         String featureLabel = feature.getLabel();