3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.io
.wizard
;
13 import org
.eclipse
.jface
.wizard
.WizardPage
;
14 import org
.eclipse
.swt
.SWT
;
15 import org
.eclipse
.swt
.events
.SelectionAdapter
;
16 import org
.eclipse
.swt
.events
.SelectionEvent
;
17 import org
.eclipse
.swt
.layout
.GridLayout
;
18 import org
.eclipse
.swt
.widgets
.Button
;
19 import org
.eclipse
.swt
.widgets
.Composite
;
21 import eu
.etaxonomy
.cdm
.io
.specimen
.abcd206
.in
.Abcd206ImportConfigurator
;
22 import eu
.etaxonomy
.cdm
.io
.specimen
.abcd206
.in
.Abcd206ImportState
;
29 public class AbcdImportConfiguratorWizardPage
extends WizardPage
{
31 public static final String PAGE_NAME
= "AbcdImportConfiguratorWizardPage";
33 private Abcd206ImportConfigurator
<Abcd206ImportState
, ?
> configurator
;
35 protected AbcdImportConfiguratorWizardPage(String title
, String description
, Abcd206ImportConfigurator
<Abcd206ImportState
, ?
> configurator
) {
37 this.configurator
= configurator
;
39 setDescription(description
);
42 public static AbcdImportConfiguratorWizardPage
createPage(Abcd206ImportConfigurator
<Abcd206ImportState
, ?
> configurator
){
43 return new AbcdImportConfiguratorWizardPage("Configure import parameters",
44 "Tooltips will explain parameters in more detail", configurator
);
51 public void createControl(Composite parent
) {
52 final Composite composite
= new Composite(parent
, SWT
.NULL
);
54 GridLayout gridLayout
= new GridLayout();
55 composite
.setLayout(gridLayout
);
57 Button checkBoxMediaSpecimen
= new Button(composite
, SWT
.CHECK
);
58 checkBoxMediaSpecimen
.setSelection(configurator
.isAddMediaAsMediaSpecimen());
59 checkBoxMediaSpecimen
.setText("Import media as media specimen");
61 .setToolTipText("Any media attached to a ABCD unit will be imported as a sub derivative of the specimen created from this unit");
62 checkBoxMediaSpecimen
.addSelectionListener(new SelectionAdapter() {
64 public void widgetSelected(SelectionEvent e
) {
65 configurator
.setAddMediaAsMediaSpecimen(!configurator
.isAddMediaAsMediaSpecimen());
69 Button checkBoxIgnoreExisting
= new Button(composite
, SWT
.CHECK
);
70 checkBoxIgnoreExisting
.setSelection(configurator
.isIgnoreImportOfExistingSpecimen());
71 checkBoxIgnoreExisting
.setText("Do not import existing specimens");
72 checkBoxIgnoreExisting
73 .setToolTipText("Specimens that have previously been imported will be ignored in this import");
74 checkBoxIgnoreExisting
.addSelectionListener(new SelectionAdapter() {
76 public void widgetSelected(SelectionEvent e
) {
77 configurator
.setIgnoreImportOfExistingSpecimen(!configurator
.isIgnoreImportOfExistingSpecimen());
81 Button checkBoxIgnoreAuthorship
= new Button(composite
, SWT
.CHECK
);
82 checkBoxIgnoreAuthorship
.setSelection(configurator
.isIgnoreAuthorship());
83 checkBoxIgnoreAuthorship
.setText("Ignore Authorship for name matching");
84 checkBoxIgnoreAuthorship
85 .setToolTipText("Name matching with existing names will be done without "
86 + "the authorship part of the name");
87 checkBoxIgnoreAuthorship
.addSelectionListener(new SelectionAdapter() {
89 public void widgetSelected(SelectionEvent e
) {
90 configurator
.setIgnoreAuthorship(!configurator
.isIgnoreAuthorship());
94 Button checkBoxMapUnitIdToCatalogNumber
= new Button(composite
, SWT
.CHECK
);
95 checkBoxMapUnitIdToCatalogNumber
.setSelection(configurator
.isMapUnitIdToCatalogNumber());
96 checkBoxMapUnitIdToCatalogNumber
.setText("Map UnitID to catalog number");
97 checkBoxMapUnitIdToCatalogNumber
98 .setToolTipText("The UnitID of every ABCD unit will be mapped the catalog number "
100 checkBoxMapUnitIdToCatalogNumber
.addSelectionListener(new SelectionAdapter() {
102 public void widgetSelected(SelectionEvent e
) {
103 configurator
.setMapUnitIdToCatalogNumber(!configurator
.isMapUnitIdToCatalogNumber());
107 Button checkBoxMapUnitIdToAccessionNumber
= new Button(composite
, SWT
.CHECK
);
108 checkBoxMapUnitIdToAccessionNumber
.setSelection(configurator
.isMapUnitIdToAccessionNumber());
109 checkBoxMapUnitIdToAccessionNumber
.setText("Map UnitID to accession number");
110 checkBoxMapUnitIdToAccessionNumber
111 .setToolTipText("The UnitID of every ABCD unit will be mapped the accession number "
112 + "of the specimen");
113 checkBoxMapUnitIdToAccessionNumber
.addSelectionListener(new SelectionAdapter() {
115 public void widgetSelected(SelectionEvent e
) {
116 configurator
.setMapUnitIdToAccessionNumber(!configurator
.isMapUnitIdToAccessionNumber());
120 Button checkBoxMapUnitIdToBarcode
= new Button(composite
, SWT
.CHECK
);
121 checkBoxMapUnitIdToBarcode
.setSelection(configurator
.isMapUnitIdToBarcode());
122 checkBoxMapUnitIdToBarcode
.setText("Map UnitID to barcode");
123 checkBoxMapUnitIdToBarcode
124 .setToolTipText("The UnitID of every ABCD unit will be mapped the barcode "
125 + "of the specimen");
126 checkBoxMapUnitIdToBarcode
.addSelectionListener(new SelectionAdapter() {
128 public void widgetSelected(SelectionEvent e
) {
129 configurator
.setMapUnitIdToBarcode(!configurator
.isMapUnitIdToBarcode());
133 Button checkBoxRemoveCountry
= new Button(composite
, SWT
.CHECK
);
134 checkBoxRemoveCountry
.setSelection(configurator
.isRemoveCountryFromLocalityText());
135 checkBoxRemoveCountry
.setText("Remove country from locality text");
136 checkBoxRemoveCountry
137 .setToolTipText("If the locality text contains information about the "
138 + "country which is additionally stored in other ABCD "
139 + "elements then it is removed from the locality text");
140 checkBoxRemoveCountry
.addSelectionListener(new SelectionAdapter() {
142 public void widgetSelected(SelectionEvent e
) {
143 configurator
.setRemoveCountryFromLocalityText(!configurator
.isRemoveCountryFromLocalityText());
147 Button checkBoxMoveToDefaultClassification
= new Button(composite
, SWT
.CHECK
);
148 checkBoxMoveToDefaultClassification
.setSelection(configurator
.isMoveNewTaxaToDefaultClassification());
149 checkBoxMoveToDefaultClassification
.setText("Create new classification for new taxa");
150 checkBoxMoveToDefaultClassification
151 .setToolTipText("For taxa that do not exist in the data base "
152 + "a new classification will be created");
153 checkBoxMoveToDefaultClassification
.addSelectionListener(new SelectionAdapter() {
155 public void widgetSelected(SelectionEvent e
) {
156 configurator
.setRemoveCountryFromLocalityText(!configurator
.isRemoveCountryFromLocalityText());
160 setControl(composite
);