Project

General

Profile

Download (6.67 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.taxeditor.io.wizard;
11

    
12
import org.eclipse.jface.wizard.WizardPage;
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.events.SelectionAdapter;
15
import org.eclipse.swt.events.SelectionEvent;
16
import org.eclipse.swt.layout.GridLayout;
17
import org.eclipse.swt.widgets.Button;
18
import org.eclipse.swt.widgets.Composite;
19

    
20
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
21
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportState;
22

    
23
/**
24
 * 
25
 * @author pplitzner
26
 *
27
 */
28
public class AbcdImportConfiguratorWizardPage extends WizardPage {
29

    
30
	public static final String PAGE_NAME = "AbcdImportConfiguratorWizardPage";
31
	
32
	private Abcd206ImportConfigurator<Abcd206ImportState, ?> configurator;
33

    
34
	protected AbcdImportConfiguratorWizardPage(String title, String description, Abcd206ImportConfigurator<Abcd206ImportState, ?> configurator) {
35
		super(PAGE_NAME);
36
		this.configurator = configurator;
37
		setTitle(title);
38
		setDescription(description);
39
	}
40

    
41
	public static AbcdImportConfiguratorWizardPage createPage(Abcd206ImportConfigurator<Abcd206ImportState, ?> configurator){
42
		return new AbcdImportConfiguratorWizardPage("Configure import parameters",
43
				"Tooltips will explain parameters in more detail", configurator);
44
	}
45

    
46

    
47

    
48
	/** {@inheritDoc} */
49
	@Override
50
    public void createControl(Composite parent) {
51
		final Composite composite = new Composite(parent, SWT.NULL);
52

    
53
		GridLayout gridLayout = new GridLayout();
54
		composite.setLayout(gridLayout);
55

    
56
		Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK);
57
		checkBoxMediaSpecimen.setSelection(configurator.isAddMediaAsMediaSpecimen());
58
		checkBoxMediaSpecimen.setText("Import media as media specimen");
59
		checkBoxMediaSpecimen
60
				.setToolTipText("Any media attached to a ABCD unit will be imported as a sub derivative of the specimen created from this unit");
61
		checkBoxMediaSpecimen.addSelectionListener(new SelectionAdapter() {
62
			@Override
63
			public void widgetSelected(SelectionEvent e) {
64
				configurator.setAddMediaAsMediaSpecimen(!configurator.isAddMediaAsMediaSpecimen());
65
			}
66
		});
67

    
68
		Button checkBoxIgnoreExisting = new Button(composite, SWT.CHECK);
69
		checkBoxIgnoreExisting.setSelection(configurator.isIgnoreImportOfExistingSpecimen());
70
		checkBoxIgnoreExisting.setText("Do not import existing specimens");
71
		checkBoxIgnoreExisting
72
		.setToolTipText("Specimens that have previously been imported will be ignored in this import");
73
		checkBoxIgnoreExisting.addSelectionListener(new SelectionAdapter() {
74
			@Override
75
			public void widgetSelected(SelectionEvent e) {
76
				configurator.setIgnoreImportOfExistingSpecimen(!configurator.isIgnoreImportOfExistingSpecimen());
77
			}
78
		});
79
		
80
		Button checkBoxIgnoreAuthorship = new Button(composite, SWT.CHECK);
81
		checkBoxIgnoreAuthorship.setSelection(configurator.isIgnoreAuthorship());
82
		checkBoxIgnoreAuthorship.setText("Ignore Authorship for name matching");
83
		checkBoxIgnoreAuthorship
84
		.setToolTipText("Name matching with existing names will be done without "
85
				+ "the authorship part of the name");
86
		checkBoxIgnoreAuthorship.addSelectionListener(new SelectionAdapter() {
87
			@Override
88
			public void widgetSelected(SelectionEvent e) {
89
				configurator.setIgnoreAuthorship(!configurator.isIgnoreAuthorship());
90
			}
91
		});
92
		
93
		Button checkBoxMapUnitIdToCatalogNumber = new Button(composite, SWT.CHECK);
94
		checkBoxMapUnitIdToCatalogNumber.setSelection(configurator.isMapUnitIdToCatalogNumber());
95
		checkBoxMapUnitIdToCatalogNumber.setText("Map UnitID to catalog number");
96
		checkBoxMapUnitIdToCatalogNumber
97
		.setToolTipText("The UnitID of every ABCD unit will be mapped the catalog number "
98
				+ "of the specimen");
99
		checkBoxMapUnitIdToCatalogNumber.addSelectionListener(new SelectionAdapter() {
100
			@Override
101
			public void widgetSelected(SelectionEvent e) {
102
				configurator.setMapUnitIdToCatalogNumber(!configurator.isMapUnitIdToCatalogNumber());
103
			}
104
		});
105
		
106
		Button checkBoxMapUnitIdToAccessionNumber = new Button(composite, SWT.CHECK);
107
		checkBoxMapUnitIdToAccessionNumber.setSelection(configurator.isMapUnitIdToAccessionNumber());
108
		checkBoxMapUnitIdToAccessionNumber.setText("Map UnitID to accession number");
109
		checkBoxMapUnitIdToAccessionNumber
110
		.setToolTipText("The UnitID of every ABCD unit will be mapped the accession number "
111
				+ "of the specimen");
112
		checkBoxMapUnitIdToAccessionNumber.addSelectionListener(new SelectionAdapter() {
113
			@Override
114
			public void widgetSelected(SelectionEvent e) {
115
				configurator.setMapUnitIdToAccessionNumber(!configurator.isMapUnitIdToAccessionNumber());
116
			}
117
		});
118
		
119
		Button checkBoxMapUnitIdToBarcode = new Button(composite, SWT.CHECK);
120
		checkBoxMapUnitIdToBarcode.setSelection(configurator.isMapUnitIdToBarcode());
121
		checkBoxMapUnitIdToBarcode.setText("Map UnitID to barcode");
122
		checkBoxMapUnitIdToBarcode
123
		.setToolTipText("The UnitID of every ABCD unit will be mapped the barcode "
124
				+ "of the specimen");
125
		checkBoxMapUnitIdToBarcode.addSelectionListener(new SelectionAdapter() {
126
			@Override
127
			public void widgetSelected(SelectionEvent e) {
128
				configurator.setMapUnitIdToBarcode(!configurator.isMapUnitIdToBarcode());
129
			}
130
		});
131
		
132
		Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK);
133
		checkBoxRemoveCountry.setSelection(configurator.isRemoveCountryFromLocalityText());
134
		checkBoxRemoveCountry.setText("Remove country from locality text");
135
		checkBoxRemoveCountry
136
		.setToolTipText("If the locality text contains information about the "
137
				+ "country which is additionally stored in other ABCD "
138
				+ "elements then it is removed from the locality text");
139
		checkBoxRemoveCountry.addSelectionListener(new SelectionAdapter() {
140
			@Override
141
			public void widgetSelected(SelectionEvent e) {
142
				configurator.setRemoveCountryFromLocalityText(!configurator.isRemoveCountryFromLocalityText());
143
			}
144
		});
145
		
146
		Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK);
147
		checkBoxMoveToDefaultClassification.setSelection(configurator.isMoveNewTaxaToDefaultClassification());
148
		checkBoxMoveToDefaultClassification.setText("Create new classification for new taxa");
149
		checkBoxMoveToDefaultClassification
150
		.setToolTipText("For taxa that do not exist in the data base "
151
				+ "a new classification will be created");
152
		checkBoxMoveToDefaultClassification.addSelectionListener(new SelectionAdapter() {
153
			@Override
154
			public void widgetSelected(SelectionEvent e) {
155
				configurator.setRemoveCountryFromLocalityText(!configurator.isRemoveCountryFromLocalityText());
156
			}
157
		});
158
		
159
		setControl(composite);
160
	}
161
	
162
}
(1-1/26)