Project

General

Profile

« Previous | Next » 

Revision 2abccc58

Added by Andreas Müller over 2 years ago

ref #7981 enable source modes for checked aggregation modes and some code cleaning

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/StructuredDescriptionAggregationConfigurationWizardPage.java
187 187
        updateLowerRankCombo();
188 188
        comboLowerRank.addListener(SWT.Selection, this);
189 189

  
190
        //aggregation mode viewer
190 191
        Label aggregationModeLabel = new Label(control, SWT.NULL);
191 192
        aggregationModeLabel.setText(Messages.DistributionAggregationWizardPage_AGGREGATION_MODE);
192 193
        aggregationModeLabel.setToolTipText(Messages.DistributionAggregationWizardPage_TOOLTIP_AGGR_MODE);
......
201 202
                }
202 203
                return null;
203 204
            }
204

  
205 205
        });
206 206
        List<AggregationMode> aggregationModeList = AggregationMode.list(AggregationType.StructuredDescription);
207 207
        aggregationModeViewer.setInput(aggregationModeList);
208 208
        aggregationModeViewer.setCheckedElements(configurator.getAggregationModes().toArray());
209

  
210 209
        aggregationModeViewer.addCheckStateListener(new ICheckStateListener(){
211 210
            @Override
212 211
            public void checkStateChanged(    CheckStateChangedEvent event){
......
226 225

  
227 226
                comboSourceModeChildParent.setEnabled(toParentChecked);
228 227
                comboSourceModeWithinTaxon.setEnabled(withinChecked);
229
//                AggregationSourceMode areaMode = (AggregationSourceMode)comboSourceModeSubAreaSuperArea.getData(comboSourceModeSubAreaSuperArea.getText());
230
                AggregationSourceMode taxonMode = (AggregationSourceMode)comboSourceModeChildParent.getData(comboSourceModeChildParent.getText());
231
//                getSourceTypeViewer().getTable().setEnabled(((areachecked && (areaMode.equals(AggregationSourceMode.ALL) || areaMode.equals(AggregationSourceMode.ALL_SAMEVALUE) ) )|| toParentChecked && (taxonMode.equals(AggregationSourceMode.ALL) || taxonMode.equals(AggregationSourceMode.ALL_SAMEVALUE) )) );
232 228
                getWizard().getContainer().updateButtons();
233
              }
229
            }
234 230
        });
235 231

  
232
        //source mode within taxon
236 233
        Label sourceModeLabelWithin = new Label(control, SWT.NULL);
237

  
238 234
        sourceModeLabelWithin.setText(Messages.DistributionAggregationWizardPage_SOURCEMODE_WITHIN_TAXON);
239 235
        sourceModeLabelWithin.setToolTipText(Messages.DistributionAggregationWizardPage_TOOLTIP_SOURCEMODE_WITHIN_TAXON);
240 236
        comboSourceModeWithinTaxon = new Combo(control,  SWT.BORDER| SWT.READ_ONLY);
......
245 241
            comboSourceModeWithinTaxon.setData(mode.getLabel(), mode);
246 242
        }
247 243

  
248
        comboSourceModeWithinTaxon.setEnabled(false);
244
        comboSourceModeWithinTaxon.setEnabled(configurator.getAggregationModes().contains(AggregationMode.WithinTaxon));
249 245
        comboSourceModeWithinTaxon.select(0);
250 246
        comboSourceModeWithinTaxon.addListener(SWT.Selection, this);
251
        Label sourceModeLabel = new Label(control, SWT.NULL);
252 247

  
253
        sourceModeLabel.setText(Messages.DistributionAggregationWizardPage_SOURCEMODE_CHILD_PARENT);
254
        sourceModeLabel.setToolTipText(Messages.DistributionAggregationWizardPage_TOOLTIP_SOURCEMODE_CHILD_PARENT);
248
        //source mode child parent
249
        Label sourceModeChildParentLabel = new Label(control, SWT.NULL);
250
        sourceModeChildParentLabel.setText(Messages.DistributionAggregationWizardPage_SOURCEMODE_CHILD_PARENT);
251
        sourceModeChildParentLabel.setToolTipText(Messages.DistributionAggregationWizardPage_TOOLTIP_SOURCEMODE_CHILD_PARENT);
255 252
        comboSourceModeChildParent = new Combo(control,  SWT.BORDER| SWT.READ_ONLY);
256 253
        comboSourceModeChildParent.setText(Messages.DistributionAggregationWizardPage_AGGREGATION_MODE);
257 254

  
......
260 257
            comboSourceModeChildParent.setData(mode.getLabel(), mode);
261 258
        }
262 259

  
263
        comboSourceModeChildParent.setEnabled(false);
260
        comboSourceModeChildParent.setEnabled(configurator.getAggregationModes().contains(AggregationMode.ToParent));
264 261
        comboSourceModeChildParent.select(0);
265 262
        comboSourceModeChildParent.addListener(SWT.Selection, this);
266 263
        GridLayoutFactory.fillDefaults();
264

  
265
        //source type
266
        //TODO: distinguis within taxon and parent child source types
267 267
        Label sourceTypeLabel = new Label(control, SWT.NULL);
268 268
        sourceTypeLabel.setText(Messages.DistributionAggregationWizardPage_SOURCE_TYPE);
269 269
        sourceTypeLabel.setToolTipText(Messages.DistributionAggregationWizardPage_TOOLTIP_SOURCE_TYPE);

Also available in: Unified diff