Project

General

Profile

« Previous | Next » 

Revision a76ae357

Added by Andreas Müller over 2 years ago

ref #7981: read aggSourceMode from configurator in aggregation wizard

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/StructuredDescriptionAggregationConfigurationWizardPage.java
264 264

  
265 265
        //source mode within taxon
266 266
        Label sourceModeLabelWithin = new Label(control, SWT.NULL);
267
        int defaultSelectionIndex = 0;
267 268
        sourceModeLabelWithin.setText(Messages.DistributionAggregationWizardPage_SOURCEMODE_WITHIN_TAXON);
268 269
        sourceModeLabelWithin.setToolTipText(Messages.DistributionAggregationWizardPage_TOOLTIP_SOURCEMODE_WITHIN_TAXON);
269 270
        comboSourceModeWithinTaxon = new Combo(control,  SWT.BORDER| SWT.READ_ONLY);
270 271
        comboSourceModeWithinTaxon.setText(Messages.DistributionAggregationWizardPage_AGGREGATION_MODE);
271 272

  
273
        int index = 0;
272 274
        for (AggregationSourceMode mode :AggregationSourceMode.list(AggregationMode.WithinTaxon, AggregationType.StructuredDescription) ){
273 275
            comboSourceModeWithinTaxon.add(mode.getLabel());
274 276
            comboSourceModeWithinTaxon.setData(mode.getLabel(), mode);
277
            if (configurator.getWithinTaxonSourceMode().equals(mode)){
278
                defaultSelectionIndex = index;
279
            }
280
            index++;
275 281
        }
276 282

  
277 283
        comboSourceModeWithinTaxon.setEnabled(configurator.getAggregationModes().contains(AggregationMode.WithinTaxon));
278
        comboSourceModeWithinTaxon.select(0);
284
        comboSourceModeWithinTaxon.select(defaultSelectionIndex);
279 285
        comboSourceModeWithinTaxon.addListener(SWT.Selection, this);
280 286

  
281 287
        //source mode child parent
......
285 291
        comboSourceModeChildParent = new Combo(control,  SWT.BORDER| SWT.READ_ONLY);
286 292
        comboSourceModeChildParent.setText(Messages.DistributionAggregationWizardPage_AGGREGATION_MODE);
287 293

  
294
        index = 0;
288 295
        for (AggregationSourceMode mode :AggregationSourceMode.list(AggregationMode.ToParent, AggregationType.StructuredDescription) ){
289 296
            comboSourceModeChildParent.add(mode.getLabel());
290 297
            comboSourceModeChildParent.setData(mode.getLabel(), mode);
298
            if (configurator.getToParentSourceMode().equals(mode)){
299
                defaultSelectionIndex = index;
300
            }
301
            index++;
291 302
        }
292 303

  
293 304
        comboSourceModeChildParent.setEnabled(configurator.getAggregationModes().contains(AggregationMode.ToParent));

Also available in: Unified diff