abcd import of siblings correct setting in configuration
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / dataimport / SpecimenSearchWizardPage.java
1 /**
2 * Copyright (C) 2013 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.view.dataimport;
10
11 import java.util.Calendar;
12
13 import org.eclipse.jface.wizard.WizardPage;
14 import org.eclipse.swt.widgets.Composite;
15
16 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
17 import eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchController;
18
19
20 /**
21 * Wizard page for entering search parameters
22 * @author pplitzner
23 * @date 12.09.2013
24 *
25 */
26 public class SpecimenSearchWizardPage extends WizardPage{
27
28 private SpecimenSearchController specimenSearchController;
29
30 protected SpecimenSearchWizardPage(String pageName) {
31 super(pageName);
32 setDescription("Specify search parameters for external search query.");
33 setTitle("Search Specimens");
34 }
35
36 /* (non-Javadoc)
37 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
38 */
39 @Override
40 public void createControl(Composite parent) {
41 specimenSearchController = SpecimenSearchController.getInstance(parent);
42 setControl(specimenSearchController.getComposite());
43 }
44
45 /**
46 * Returns an {@link OccurenceQuery} filled with the parameters defined in this wizard page
47 * @return
48 */
49 public OccurenceQuery getQuery() {
50 String accessionNumber = specimenSearchController.getAccessionNumber();
51 String collector = specimenSearchController.getCollector();
52 String collectorsNumber = specimenSearchController.getCollectorNumber();
53 String country = specimenSearchController.getCountry();
54 Calendar dateFrom = specimenSearchController.getDateFrom();
55 Calendar dateTo = specimenSearchController.getDateTo();
56 String herbarium = specimenSearchController.getHerbarium();
57 String locality = specimenSearchController.getLocality();
58 String taxonName = specimenSearchController.getTaxonName();
59 return new OccurenceQuery(taxonName, collector, collectorsNumber, accessionNumber, herbarium, country, locality, dateFrom, dateTo);
60 }
61
62 /**
63 * @return the specimenSearchController
64 */
65 public SpecimenSearchController getController() {
66 return specimenSearchController;
67 }
68
69
70
71 }