Revision 724c463a
Added by Katja Luther over 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/DistributionAggregationWizardPage.java | ||
---|---|---|
305 | 305 |
buttonSuperArea.setEnabled(areachecked); |
306 | 306 |
comboSourceModeSubAreaSuperArea.setEnabled(areachecked); |
307 | 307 |
comboSourceModeChildParent.setEnabled(toParentChecked); |
308 |
AggregationSourceMode areaMode = (AggregationSourceMode)comboSourceModeSubAreaSuperArea.getData(comboSourceModeSubAreaSuperArea.getText()); |
|
309 |
AggregationSourceMode taxonMode = (AggregationSourceMode)comboSourceModeChildParent.getData(comboSourceModeChildParent.getText()); |
|
310 |
sourceTypeViewer.getTable().setEnabled(((areachecked && (areaMode.equals(AggregationSourceMode.ALL) || areaMode.equals(AggregationSourceMode.ALL_SAMEVALUE) ) )|| toParentChecked && (taxonMode.equals(AggregationSourceMode.ALL) || taxonMode.equals(AggregationSourceMode.ALL_SAMEVALUE) )) ); |
|
308 | 311 |
getWizard().getContainer().updateButtons(); |
309 | 312 |
} |
310 | 313 |
}); |
... | ... | |
347 | 350 |
sourceModeLabel.setToolTipText("Defines the source mode if aggregation from child to parent taxon is selected."); |
348 | 351 |
comboSourceModeChildParent = new Combo(control, SWT.BORDER| SWT.READ_ONLY); |
349 | 352 |
comboSourceModeChildParent.setText(Messages.DistributionAggregationConfiguration_AggregationMode); |
350 |
comboSourceModeChildParent.add("None"); |
|
351 |
comboSourceModeChildParent.setData(null); |
|
353 |
|
|
352 | 354 |
for (AggregationSourceMode mode :AggregationSourceMode.values()){ |
353 | 355 |
comboSourceModeChildParent.add(mode.toString()); |
354 | 356 |
comboSourceModeChildParent.setData(mode.toString(), mode); |
... | ... | |
364 | 366 |
sourceModeLabelSuperArea.setToolTipText("Defines the source mode if aggregation from sub area to super area is selected."); |
365 | 367 |
comboSourceModeSubAreaSuperArea = new Combo(control, SWT.BORDER| SWT.READ_ONLY); |
366 | 368 |
comboSourceModeSubAreaSuperArea.setText(Messages.DistributionAggregationConfiguration_AggregationMode); |
367 |
comboSourceModeSubAreaSuperArea.add("None"); |
|
368 |
comboSourceModeSubAreaSuperArea.setData(null); |
|
369 |
|
|
369 | 370 |
for (AggregationSourceMode mode :AggregationSourceMode.values()){ |
370 | 371 |
comboSourceModeSubAreaSuperArea.add(mode.toString()); |
371 | 372 |
comboSourceModeSubAreaSuperArea.setData(mode.toString(), mode); |
... | ... | |
374 | 375 |
comboSourceModeSubAreaSuperArea.addSelectionListener(this); |
375 | 376 |
comboSourceModeSubAreaSuperArea.setEnabled(false); |
376 | 377 |
comboSourceModeSubAreaSuperArea.select(0); |
378 |
|
|
377 | 379 |
Label sourceTypeLabel = new Label(control, SWT.NULL); |
378 | 380 |
sourceTypeLabel.setText("Source type"); |
379 | 381 |
sourceTypeLabel.setToolTipText("Type of sources that should added to the aggregated distribution"); |
... | ... | |
439 | 441 |
if (e.getSource().equals(comboSourceModeChildParent) || e.getSource().equals(comboSourceModeSubAreaSuperArea)){ |
440 | 442 |
AggregationSourceMode modeChild = (AggregationSourceMode)comboSourceModeChildParent.getData(comboSourceModeChildParent.getText()); |
441 | 443 |
AggregationSourceMode modeArea = (AggregationSourceMode)comboSourceModeSubAreaSuperArea.getData(comboSourceModeSubAreaSuperArea.getText()); |
442 |
if ((modeChild != null && modeChild.equals(AggregationSourceMode.ALL) || modeChild.equals(AggregationSourceMode.ALL_SAMEVALUE)) ||(modeArea != null && modeArea.equals(AggregationSourceMode.ALL) || modeArea.equals(AggregationSourceMode.ALL_SAMEVALUE))){
|
|
444 |
if ((comboSourceModeChildParent.isEnabled() && (modeChild != null && modeChild.equals(AggregationSourceMode.ALL) || modeChild.equals(AggregationSourceMode.ALL_SAMEVALUE))) ||(comboSourceModeSubAreaSuperArea.isEnabled() && (modeArea != null && modeArea.equals(AggregationSourceMode.ALL) || modeArea.equals(AggregationSourceMode.ALL_SAMEVALUE)))){
|
|
443 | 445 |
sourceTypeViewer.getTable().setEnabled(true); |
444 | 446 |
}else{ |
445 | 447 |
sourceTypeViewer.getTable().setEnabled(false); |
Also available in: Unified diff
ref #8677: correct enabling and disabling of elements