3 * Copyright (C) 2013 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.
10 package eu
.etaxonomy
.taxeditor
.editor
.view
.dataimport
;
12 import java
.util
.Calendar
;
14 import org
.eclipse
.jface
.wizard
.WizardPage
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
17 import eu
.etaxonomy
.cdm
.ext
.occurrence
.OccurenceQuery
;
18 import eu
.etaxonomy
.taxeditor
.view
.specimenSearch
.SpecimenSearchController
;
22 * Wizard page for entering search parameters
27 public class SpecimenSearchWizardPage
extends WizardPage
{
29 private SpecimenSearchController specimenSearchController
;
31 protected SpecimenSearchWizardPage(String pageName
) {
33 setDescription("Specify search parameters for external search query.");
34 setTitle("Search Specimens");
38 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
41 public void createControl(Composite parent
) {
42 specimenSearchController
= SpecimenSearchController
.getInstance(parent
);
43 setControl(specimenSearchController
.getComposite());
47 * Returns an {@link OccurenceQuery} filled with the parameters defined in this wizard page
50 public OccurenceQuery
getQuery() {
51 String accessionNumber
= specimenSearchController
.getAccessionNumber();
52 String collector
= specimenSearchController
.getCollector();
53 String collectorsNumber
= specimenSearchController
.getCollectorNumber();
54 String country
= specimenSearchController
.getCountry();
55 Calendar dateFrom
= specimenSearchController
.getDateFrom();
56 Calendar dateTo
= specimenSearchController
.getDateTo();
57 String herbarium
= specimenSearchController
.getHerbarium();
58 String locality
= specimenSearchController
.getLocality();
59 String taxonName
= specimenSearchController
.getTaxonName();
60 return new OccurenceQuery(taxonName
, collector
, collectorsNumber
, accessionNumber
, herbarium
, country
, locality
, dateFrom
, dateTo
);
64 * @return the specimenSearchController
66 public SpecimenSearchController
getController() {
67 return specimenSearchController
;