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
.ui
.campanula
.specimenSearch
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.widgets
.Composite
;
16 * Controller class for handling a {@link SpecimenSearchComposite}.
21 public class SpecimenSearchController
{
23 private final SpecimenSearchComposite specimenSearchComposite
;
26 * @param specimenSearchComposite
28 public SpecimenSearchController(Composite parent
) {
29 this.specimenSearchComposite
= new SpecimenSearchComposite(parent
, SWT
.NONE
);
33 * Returns the {@link Composite} handled by this controller
36 public Composite
getComposite() {
37 return specimenSearchComposite
;
41 * Returns the taxon name entered in the search view
42 * @return the taxon name as a {@link String}
43 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextTaxonName()
45 public String
getTaxonName() {
46 return specimenSearchComposite
.getTextTaxonName().getText();
50 * Returns the collector entered in the search view
51 * @return the collector as a {@link String}
52 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextCollector()
54 public String
getCollector() {
55 return specimenSearchComposite
.getTextCollector().getText();
59 * Returns the collecting number entered in the search view
60 * @return the collecting as a {@link String}
61 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextCollectorNumber()
63 public String
getCollectorNumber() {
64 return specimenSearchComposite
.getTextCollectorNumber().getText();
68 * Returns the accession number entered in the search view
69 * @return the accession number as a {@link String}
70 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextAccessionNumber()
72 public String
getAccessionNumber() {
73 return specimenSearchComposite
.getTextAccessionNumber().getText();
77 * Returns the herbarium entered in the search view
78 * @return the herbarium as a {@link String}
79 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getComboHerbarium()
81 public String
getHerbarium() {
83 // return specimenSearchComposite.getComboHerbarium().getItem(specimenSearchComposite.getComboHerbarium().getSelectionIndex());
87 * Returns the country entered in the search view
88 * @return the country as a {@link String}
89 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getComboCountry()
91 public String
getCountry() {
93 // return specimenSearchComposite.getComboCountry().getItem(specimenSearchComposite.getComboCountry().getSelectionIndex());
97 * Returns the locality entered in the search view
98 * @return the locality as a {@link String}
99 * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextLocality()
101 public String
getLocality() {
102 return specimenSearchComposite
.getTextLocality().getText();