1
|
/**
|
2
|
* Copyright (C) 2016 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator;
|
10
|
|
11
|
import org.eclipse.core.databinding.beans.PojoProperties;
|
12
|
import org.eclipse.core.databinding.observable.value.IObservableValue;
|
13
|
import org.eclipse.jface.databinding.swt.WidgetProperties;
|
14
|
import org.eclipse.swt.SWT;
|
15
|
import org.eclipse.swt.widgets.Button;
|
16
|
import org.eclipse.swt.widgets.Composite;
|
17
|
|
18
|
import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
|
19
|
|
20
|
/**
|
21
|
* @author k.luther
|
22
|
* @date 19.04.2016
|
23
|
*
|
24
|
*/
|
25
|
public class DeleteTaxonConfiguratorComposite extends DeleteTaxonBaseConfiguratorComposite {
|
26
|
|
27
|
private final Button btnDeleteSynonyms;
|
28
|
private final Button btnDeleteMisappliedNamesAndInvalidDesignations;
|
29
|
private final Button btnTaxonRelationships;
|
30
|
private final Button btnConceptRelationships;
|
31
|
/**
|
32
|
* @param configurator
|
33
|
* @param parent
|
34
|
* @param style
|
35
|
*/
|
36
|
public DeleteTaxonConfiguratorComposite(TaxonBaseDeletionConfigurator configurator, Composite parent, int style) {
|
37
|
super(configurator, parent, style);
|
38
|
btnDeleteSynonyms = new Button(this, SWT.CHECK);
|
39
|
btnDeleteSynonyms.setText("Delete synonyms if possible");
|
40
|
btnDeleteSynonyms.setSelection(true);
|
41
|
|
42
|
btnDeleteMisappliedNamesAndInvalidDesignations = new Button(this, SWT.CHECK);
|
43
|
btnDeleteMisappliedNamesAndInvalidDesignations.setText("Delete misapplied names and invalid designations if possible");
|
44
|
btnDeleteMisappliedNamesAndInvalidDesignations.setSelection(true);
|
45
|
|
46
|
|
47
|
btnTaxonRelationships = new Button(this, SWT.CHECK);
|
48
|
btnTaxonRelationships.setText("Delete taxon relations if possible");
|
49
|
btnTaxonRelationships.setSelection(true);
|
50
|
|
51
|
btnConceptRelationships = new Button(this, SWT.CHECK);
|
52
|
btnConceptRelationships.setText("Delete concept relations if possible");
|
53
|
btnConceptRelationships.setSelection(true);
|
54
|
initDataBindingsTaxon();
|
55
|
}
|
56
|
|
57
|
protected void initDataBindingsTaxon() {
|
58
|
|
59
|
IObservableValue observeSelectionBtnDeleteSynonymsObserveWidget = WidgetProperties.selection().observe(btnDeleteSynonyms);
|
60
|
IObservableValue deleteSynonymsConfiguratorObserveValue = PojoProperties.value("deleteSynonymsIfPossible").observe(configurator);
|
61
|
m_bindingContext.bindValue(observeSelectionBtnDeleteSynonymsObserveWidget, deleteSynonymsConfiguratorObserveValue, null, null);
|
62
|
|
63
|
IObservableValue observeSelectionbtnDeleteMisappliedNamesAndInvalidDesignationsObserveWidget = WidgetProperties.selection().observe(btnDeleteMisappliedNamesAndInvalidDesignations);
|
64
|
IObservableValue deleteMisappliedNamesAndInvalidDesignationsConfiguratorObserveValue = PojoProperties.value("deleteMisappliedNamesAndInvalidDesignationsIfPossible").observe(configurator);
|
65
|
m_bindingContext.bindValue(observeSelectionbtnDeleteMisappliedNamesAndInvalidDesignationsObserveWidget, deleteMisappliedNamesAndInvalidDesignationsConfiguratorObserveValue, null, null);
|
66
|
|
67
|
IObservableValue observeSelectionbtnTaxonRelationshipsObserveWidget = WidgetProperties.selection().observe(btnTaxonRelationships);
|
68
|
IObservableValue deleteTaxonRelationshipsConfiguratorObserveValue = PojoProperties.value("deleteTaxonRelationships").observe(configurator);
|
69
|
m_bindingContext.bindValue(observeSelectionbtnTaxonRelationshipsObserveWidget, deleteTaxonRelationshipsConfiguratorObserveValue, null, null);
|
70
|
|
71
|
IObservableValue observeSelectionbtnConceptRelationshipsObserveWidget = WidgetProperties.selection().observe(btnConceptRelationships);
|
72
|
IObservableValue deleteConceptRelationshipsConfiguratorObserveValue = PojoProperties.value("deleteConceptRelationships").observe(configurator);
|
73
|
m_bindingContext.bindValue(observeSelectionbtnConceptRelationshipsObserveWidget, deleteConceptRelationshipsConfiguratorObserveValue, null, null);
|
74
|
|
75
|
}
|
76
|
}
|