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.view.specimenSearch;
|
11
|
|
12
|
import org.eclipse.swt.SWT;
|
13
|
import org.eclipse.swt.widgets.Composite;
|
14
|
|
15
|
/**
|
16
|
* Controller class for handling a {@link SpecimenSearchComposite}.
|
17
|
* @author pplitzner
|
18
|
* @date 03.09.2013
|
19
|
*
|
20
|
*/
|
21
|
public class SpecimenSearchController {
|
22
|
|
23
|
private final SpecimenSearchComposite specimenSearchComposite;
|
24
|
|
25
|
/**
|
26
|
* @param specimenSearchComposite
|
27
|
*/
|
28
|
public SpecimenSearchController(Composite parent) {
|
29
|
this.specimenSearchComposite = new SpecimenSearchComposite(parent, SWT.NONE);
|
30
|
}
|
31
|
|
32
|
/**
|
33
|
* Returns the {@link Composite} handled by this controller
|
34
|
* @return
|
35
|
*/
|
36
|
public Composite getComposite() {
|
37
|
return specimenSearchComposite;
|
38
|
}
|
39
|
|
40
|
/**
|
41
|
* Returns the taxon name entered in the search view
|
42
|
* @return the taxon name as a {@link String}
|
43
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getTextTaxonName()
|
44
|
*/
|
45
|
public String getTaxonName() {
|
46
|
return specimenSearchComposite.getTextTaxonName().getText();
|
47
|
}
|
48
|
|
49
|
/**
|
50
|
* Returns the collector entered in the search view
|
51
|
* @return the collector as a {@link String}
|
52
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getTextCollector()
|
53
|
*/
|
54
|
public String getCollector() {
|
55
|
return specimenSearchComposite.getTextCollector().getText();
|
56
|
}
|
57
|
|
58
|
/**
|
59
|
* Returns the collecting number entered in the search view
|
60
|
* @return the collecting as a {@link String}
|
61
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getTextCollectorNumber()
|
62
|
*/
|
63
|
public String getCollectorNumber() {
|
64
|
return specimenSearchComposite.getTextCollectorNumber().getText();
|
65
|
}
|
66
|
|
67
|
/**
|
68
|
* Returns the accession number entered in the search view
|
69
|
* @return the accession number as a {@link String}
|
70
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getTextAccessionNumber()
|
71
|
*/
|
72
|
public String getAccessionNumber() {
|
73
|
return specimenSearchComposite.getTextAccessionNumber().getText();
|
74
|
}
|
75
|
|
76
|
/**
|
77
|
* Returns the herbarium entered in the search view
|
78
|
* @return the herbarium as a {@link String}
|
79
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getComboHerbarium()
|
80
|
*/
|
81
|
public String getHerbarium() {
|
82
|
return specimenSearchComposite.getTextHerbarium().getText();
|
83
|
// return specimenSearchComposite.getComboHerbarium().getItem(specimenSearchComposite.getComboHerbarium().getSelectionIndex());
|
84
|
}
|
85
|
|
86
|
/**
|
87
|
* Returns the country entered in the search view
|
88
|
* @return the country as a {@link String}
|
89
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getComboCountry()
|
90
|
*/
|
91
|
public String getCountry() {
|
92
|
return specimenSearchComposite.getTextCountry().getText();
|
93
|
// return specimenSearchComposite.getComboCountry().getItem(specimenSearchComposite.getComboCountry().getSelectionIndex());
|
94
|
}
|
95
|
|
96
|
/**
|
97
|
* Returns the locality entered in the search view
|
98
|
* @return the locality as a {@link String}
|
99
|
* @see eu.etaxonomy.taxeditor.view.specimenSearch.SpecimenSearchComposite#getTextLocality()
|
100
|
*/
|
101
|
public String getLocality() {
|
102
|
return specimenSearchComposite.getTextLocality().getText();
|
103
|
}
|
104
|
|
105
|
}
|