1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2013 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
package eu.etaxonomy.taxeditor.editor.view.dataimport;
|
11
|
|
12
|
import org.eclipse.jface.wizard.WizardPage;
|
13
|
import org.eclipse.swt.widgets.Composite;
|
14
|
|
15
|
import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
|
16
|
import eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchController;
|
17
|
|
18
|
|
19
|
/**
|
20
|
* Wizard page for entering search parameters
|
21
|
* @author pplitzner
|
22
|
* @date 12.09.2013
|
23
|
*
|
24
|
*/
|
25
|
public class SpecimenSearchWizardPage extends WizardPage{
|
26
|
|
27
|
private SpecimenSearchController specimenSearchController;
|
28
|
|
29
|
protected SpecimenSearchWizardPage(String pageName) {
|
30
|
super(pageName);
|
31
|
setDescription("Specify search parameters for external search query.");
|
32
|
setTitle("Search Specimens");
|
33
|
}
|
34
|
|
35
|
/* (non-Javadoc)
|
36
|
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
|
37
|
*/
|
38
|
@Override
|
39
|
public void createControl(Composite parent) {
|
40
|
specimenSearchController = new SpecimenSearchController(parent);
|
41
|
setControl(specimenSearchController.getComposite());
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* Returns an {@link OccurenceQuery} filled with the parameters defined in this wizard page
|
46
|
* @return
|
47
|
*/
|
48
|
public OccurenceQuery getQuery() {
|
49
|
String accessionNumber = specimenSearchController.getAccessionNumber();
|
50
|
String collector = specimenSearchController.getCollector();
|
51
|
String collectorsNumber = specimenSearchController.getCollectorNumber();
|
52
|
String country = specimenSearchController.getCountry();
|
53
|
// date = specimenSearchController.getDate();
|
54
|
String herbarium = specimenSearchController.getHerbarium();
|
55
|
String locality = specimenSearchController.getLocality();
|
56
|
String taxonName = specimenSearchController.getTaxonName();
|
57
|
return new OccurenceQuery(taxonName, collector, collectorsNumber, accessionNumber, herbarium, country, locality, null);
|
58
|
}
|
59
|
|
60
|
}
|