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
|
import org.eclipse.swt.widgets.Display;
|
15
|
import org.eclipse.swt.widgets.Label;
|
16
|
import org.eclipse.swt.widgets.Text;
|
17
|
import org.eclipse.ui.forms.widgets.FormToolkit;
|
18
|
import org.eclipse.ui.forms.widgets.TableWrapData;
|
19
|
import org.eclipse.ui.forms.widgets.TableWrapLayout;
|
20
|
|
21
|
/**
|
22
|
* @author pplitzner
|
23
|
* @date 03.09.2013
|
24
|
*
|
25
|
*/
|
26
|
public class SpecimenSearchComposite extends Composite {
|
27
|
private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
|
28
|
private final Text textTaxonName;
|
29
|
private final Text textCollector;
|
30
|
private final Text textCollectorNumber;
|
31
|
private final Text textAccessionNumber;
|
32
|
private final Text textLocality;
|
33
|
private final Text textHerbarium;
|
34
|
private final Text textCountry;
|
35
|
|
36
|
/**
|
37
|
* Create the composite.
|
38
|
* @param parent
|
39
|
* @setBackgroundMode(SWT.INHERIT_DEFAULT);
|
40
|
param style
|
41
|
*/
|
42
|
public SpecimenSearchComposite(Composite parent, int style) {
|
43
|
super(parent, style);
|
44
|
{
|
45
|
TableWrapLayout tableWrapLayout = new TableWrapLayout();
|
46
|
tableWrapLayout.numColumns = 2;
|
47
|
setLayout(tableWrapLayout);
|
48
|
}
|
49
|
|
50
|
Label lblTaxonName = new Label(this, SWT.NONE);
|
51
|
lblTaxonName.setText("Taxon Name");
|
52
|
|
53
|
textTaxonName = new Text(this, SWT.NONE);
|
54
|
textTaxonName.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
55
|
|
56
|
Label lblCollectors = new Label(this, SWT.NONE);
|
57
|
lblCollectors.setText("Collector(s)");
|
58
|
|
59
|
textCollector = new Text(this, SWT.NONE);
|
60
|
textCollector.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
61
|
formToolkit.adapt(textCollector, true, true);
|
62
|
|
63
|
Label lblCollectorsNumber = new Label(this, SWT.NONE);
|
64
|
lblCollectorsNumber.setText("Collector(s) Number");
|
65
|
|
66
|
textCollectorNumber = new Text(this, SWT.NONE);
|
67
|
textCollectorNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
68
|
formToolkit.adapt(textCollectorNumber, true, true);
|
69
|
|
70
|
Label lblAccessionNumber = new Label(this, SWT.NONE);
|
71
|
lblAccessionNumber.setText("Accession Number");
|
72
|
|
73
|
textAccessionNumber = new Text(this, SWT.NONE);
|
74
|
textAccessionNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
75
|
formToolkit.adapt(textAccessionNumber, true, true);
|
76
|
|
77
|
Label lblHerbarium = new Label(this, SWT.NONE);
|
78
|
lblHerbarium.setText("Herbarium");
|
79
|
|
80
|
textHerbarium = new Text(this, SWT.NONE);
|
81
|
textHerbarium.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
82
|
|
83
|
Label lblCountry = new Label(this, SWT.NONE);
|
84
|
lblCountry.setText("Country");
|
85
|
|
86
|
textCountry = new Text(this, SWT.NONE);
|
87
|
textCountry.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
88
|
|
89
|
Label lblLocality = new Label(this, SWT.NONE);
|
90
|
lblLocality.setText("Locality");
|
91
|
|
92
|
textLocality = new Text(this, SWT.NONE);
|
93
|
textLocality.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
94
|
formToolkit.adapt(textLocality, true, true);
|
95
|
|
96
|
Label lblCollectionDate = new Label(this, SWT.NONE);
|
97
|
lblCollectionDate.setText("Collection Date");
|
98
|
new Label(this, SWT.NONE);
|
99
|
|
100
|
}
|
101
|
|
102
|
@Override
|
103
|
protected void checkSubclass() {
|
104
|
// Disable the check that prevents subclassing of SWT components
|
105
|
}
|
106
|
|
107
|
public Text getTextTaxonName() {
|
108
|
return textTaxonName;
|
109
|
}
|
110
|
public Text getTextCollector() {
|
111
|
return textCollector;
|
112
|
}
|
113
|
public Text getTextCollectorNumber() {
|
114
|
return textCollectorNumber;
|
115
|
}
|
116
|
public Text getTextAccessionNumber() {
|
117
|
return textAccessionNumber;
|
118
|
}
|
119
|
public Text getTextHerbarium() {
|
120
|
return textHerbarium;
|
121
|
}
|
122
|
public Text getTextCountry() {
|
123
|
return textCountry;
|
124
|
}
|
125
|
public Text getTextLocality() {
|
126
|
return textLocality;
|
127
|
}
|
128
|
}
|