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.databaseAdmin.wizard;
|
10
|
|
11
|
import org.eclipse.jface.wizard.WizardPage;
|
12
|
import org.eclipse.swt.SWT;
|
13
|
import org.eclipse.swt.events.SelectionAdapter;
|
14
|
import org.eclipse.swt.events.SelectionEvent;
|
15
|
import org.eclipse.swt.layout.GridLayout;
|
16
|
import org.eclipse.swt.widgets.Button;
|
17
|
import org.eclipse.swt.widgets.Composite;
|
18
|
|
19
|
import eu.etaxonomy.cdm.api.service.config.CacheUpdaterConfigurator;
|
20
|
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
|
21
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
22
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
23
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
24
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
25
|
import eu.etaxonomy.taxeditor.l10n.Messages;
|
26
|
|
27
|
/**
|
28
|
* @author k.luther
|
29
|
* @date 14.12.2016
|
30
|
*
|
31
|
*/
|
32
|
public class CacheUpdaterWizardPage extends WizardPage {
|
33
|
|
34
|
CacheUpdaterConfigurator config;
|
35
|
|
36
|
boolean updateAgentBase = false;
|
37
|
boolean updateReference = false;
|
38
|
boolean updateTaxonBase = false;
|
39
|
boolean updateName = false;
|
40
|
boolean updateSpecimen = false;
|
41
|
|
42
|
public CacheUpdaterWizardPage(String pageName, CacheUpdaterConfigurator configTitleCache) {
|
43
|
super(pageName);
|
44
|
this.setDescription(Messages.DatabaseRepairPage_description);
|
45
|
config = configTitleCache;
|
46
|
|
47
|
}
|
48
|
|
49
|
/**
|
50
|
* {@inheritDoc}
|
51
|
*/
|
52
|
@Override
|
53
|
public void createControl(Composite parent) {
|
54
|
|
55
|
|
56
|
Composite composite = new Composite(parent, SWT.NONE);
|
57
|
|
58
|
composite.setLayout(new GridLayout(1, true));
|
59
|
setControl(composite);
|
60
|
Button checkBoxTeamOrPerson = new Button(composite, SWT.CHECK);
|
61
|
checkBoxTeamOrPerson.setSelection(config.getClassList().contains(TeamOrPersonBase.class));
|
62
|
checkBoxTeamOrPerson.setText(Messages.DatabaseRepairPage_TeamOrPerson);
|
63
|
checkBoxTeamOrPerson
|
64
|
.setToolTipText(Messages.DatabaseRepairPage_toolTip_teamOrPerson);
|
65
|
checkBoxTeamOrPerson.addSelectionListener(new SelectionAdapter() {
|
66
|
@Override
|
67
|
public void widgetSelected(SelectionEvent e) {
|
68
|
Button b = (Button) e.widget;
|
69
|
updateAgentBase = b.getSelection();
|
70
|
|
71
|
}
|
72
|
});
|
73
|
|
74
|
Button checkBoxReference = new Button(composite, SWT.CHECK);
|
75
|
checkBoxReference.setSelection(config.getClassList().contains(Reference.class));
|
76
|
checkBoxReference.setText(Messages.DatabaseRepairPage_Reference);
|
77
|
checkBoxReference
|
78
|
.setToolTipText(Messages.DatabaseRepairPage_toolTip_reference);
|
79
|
checkBoxReference.addSelectionListener(new SelectionAdapter() {
|
80
|
@Override
|
81
|
public void widgetSelected(SelectionEvent e) {
|
82
|
Button b = (Button) e.widget;
|
83
|
updateReference= b.getSelection();
|
84
|
}
|
85
|
});
|
86
|
|
87
|
Button checkBoxTaxonName = new Button(composite, SWT.CHECK);
|
88
|
checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonName.class));
|
89
|
checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName);
|
90
|
checkBoxTaxonName
|
91
|
.setToolTipText(Messages.DatabaseRepairPage_toolTip_TaxonName);
|
92
|
checkBoxTaxonName.addSelectionListener(new SelectionAdapter() {
|
93
|
@Override
|
94
|
public void widgetSelected(SelectionEvent e) {
|
95
|
Button b = (Button) e.widget;
|
96
|
updateName = b.getSelection();
|
97
|
|
98
|
}
|
99
|
});
|
100
|
|
101
|
Button checkBoxTaxonBase = new Button(composite, SWT.CHECK);
|
102
|
checkBoxTaxonBase.setSelection(config.getClassList().contains(TaxonBase.class));
|
103
|
checkBoxTaxonBase.setText(Messages.DatabaseRepairPage_TaxonBase);
|
104
|
checkBoxTaxonBase
|
105
|
.setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonBase);
|
106
|
checkBoxTaxonBase.addSelectionListener(new SelectionAdapter() {
|
107
|
@Override
|
108
|
public void widgetSelected(SelectionEvent e) {
|
109
|
Button b = (Button) e.widget;
|
110
|
updateTaxonBase = b.getSelection();
|
111
|
|
112
|
}
|
113
|
});
|
114
|
|
115
|
|
116
|
Button checkBoxSpecimen = new Button(composite, SWT.CHECK);
|
117
|
checkBoxSpecimen.setSelection(config.getClassList().contains(SpecimenOrObservationBase.class));
|
118
|
checkBoxSpecimen.setText(Messages.DatabaseRepairPage_Specimen);
|
119
|
checkBoxSpecimen
|
120
|
.setToolTipText(Messages.DatabaseRepairPage_toolTip_specimen);
|
121
|
checkBoxSpecimen.addSelectionListener(new SelectionAdapter() {
|
122
|
@Override
|
123
|
public void widgetSelected(SelectionEvent e) {
|
124
|
Button b = (Button) e.widget;
|
125
|
updateSpecimen = b.getSelection();
|
126
|
|
127
|
}
|
128
|
});
|
129
|
|
130
|
|
131
|
}
|
132
|
}
|