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
.view
.specimenSearch
;
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
;
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
;
37 * Create the composite.
39 * @setBackgroundMode(SWT.INHERIT_DEFAULT);
42 public SpecimenSearchComposite(Composite parent
, int style
) {
45 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
46 tableWrapLayout
.numColumns
= 2;
47 setLayout(tableWrapLayout
);
50 Label lblTaxonName
= new Label(this, SWT
.NONE
);
51 lblTaxonName
.setText("Taxon Name");
53 textTaxonName
= new Text(this, SWT
.NONE
);
54 textTaxonName
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
56 Label lblCollectors
= new Label(this, SWT
.NONE
);
57 lblCollectors
.setText("Collector(s)");
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);
63 Label lblCollectorsNumber
= new Label(this, SWT
.NONE
);
64 lblCollectorsNumber
.setText("Collector(s) Number");
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);
70 Label lblAccessionNumber
= new Label(this, SWT
.NONE
);
71 lblAccessionNumber
.setText("Accession Number");
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);
77 Label lblHerbarium
= new Label(this, SWT
.NONE
);
78 lblHerbarium
.setText("Herbarium");
80 textHerbarium
= new Text(this, SWT
.NONE
);
81 textHerbarium
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
83 Label lblCountry
= new Label(this, SWT
.NONE
);
84 lblCountry
.setText("Country");
86 textCountry
= new Text(this, SWT
.NONE
);
87 textCountry
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
89 Label lblLocality
= new Label(this, SWT
.NONE
);
90 lblLocality
.setText("Locality");
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);
96 Label lblCollectionDate
= new Label(this, SWT
.NONE
);
97 lblCollectionDate
.setText("Collection Date");
98 new Label(this, SWT
.NONE
);
103 protected void checkSubclass() {
104 // Disable the check that prevents subclassing of SWT components
107 public Text
getTextTaxonName() {
108 return textTaxonName
;
110 public Text
getTextCollector() {
111 return textCollector
;
113 public Text
getTextCollectorNumber() {
114 return textCollectorNumber
;
116 public Text
getTextAccessionNumber() {
117 return textAccessionNumber
;
119 public Text
getTextHerbarium() {
120 return textHerbarium
;
122 public Text
getTextCountry() {
125 public Text
getTextLocality() {