merge-update from trunk
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / campanula / specimenSearch / SpecimenSearchComposite.java
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.ui.campanula.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 Text textTaxonName;
29 private Text textCollector;
30 private Text textCollectorNumber;
31 private Text textAccessionNumber;
32 private Text textLocality;
33 private Text textHerbarium;
34 private Text textCountry;
35
36 /**
37 * Create the composite.
38 * @param parent
39 * @param style
40 */
41 public SpecimenSearchComposite(Composite parent, int style) {
42 super(parent, style);
43 setBackgroundMode(SWT.INHERIT_DEFAULT);
44 {
45 TableWrapLayout tableWrapLayout = new TableWrapLayout();
46 tableWrapLayout.numColumns = 2;
47 setLayout(tableWrapLayout);
48 }
49
50 Label lblTaxonName = formToolkit.createLabel(this, "Taxon Name", SWT.NONE);
51
52 textTaxonName = new Text(this, SWT.BORDER);
53 textTaxonName.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
54 formToolkit.adapt(textTaxonName, true, true);
55
56 Label lblCollectors = new Label(this, SWT.NONE);
57 formToolkit.adapt(lblCollectors, true, true);
58 lblCollectors.setText("Collector(s)");
59
60 textCollector = new Text(this, SWT.BORDER);
61 textCollector.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
62 formToolkit.adapt(textCollector, true, true);
63
64 Label lblCollectorsNumber = new Label(this, SWT.NONE);
65 formToolkit.adapt(lblCollectorsNumber, true, true);
66 lblCollectorsNumber.setText("Collector(s) Number");
67
68 textCollectorNumber = new Text(this, SWT.BORDER);
69 textCollectorNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
70 formToolkit.adapt(textCollectorNumber, true, true);
71
72 Label lblAccessionNumber = new Label(this, SWT.NONE);
73 formToolkit.adapt(lblAccessionNumber, true, true);
74 lblAccessionNumber.setText("Accession Number");
75
76 textAccessionNumber = new Text(this, SWT.BORDER);
77 textAccessionNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
78 formToolkit.adapt(textAccessionNumber, true, true);
79
80 Label lblHerbarium = new Label(this, SWT.NONE);
81 formToolkit.adapt(lblHerbarium, true, true);
82 lblHerbarium.setText("Herbarium");
83
84 textHerbarium = new Text(this, SWT.NONE);
85 textHerbarium.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
86
87 Label lblCountry = new Label(this, SWT.NONE);
88 formToolkit.adapt(lblCountry, true, true);
89 lblCountry.setText("Country");
90
91 textCountry = new Text(this, SWT.NONE);
92 textCountry.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
93
94 Label lblLocality = new Label(this, SWT.NONE);
95 formToolkit.adapt(lblLocality, true, true);
96 lblLocality.setText("Locality");
97
98 textLocality = new Text(this, SWT.BORDER);
99 textLocality.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
100 formToolkit.adapt(textLocality, true, true);
101
102 Label lblCollectionDate = new Label(this, SWT.NONE);
103 formToolkit.adapt(lblCollectionDate, true, true);
104 lblCollectionDate.setText("Collection Date");
105 new Label(this, SWT.NONE);
106
107 }
108
109 @Override
110 protected void checkSubclass() {
111 // Disable the check that prevents subclassing of SWT components
112 }
113
114 public Text getTextTaxonName() {
115 return textTaxonName;
116 }
117 public Text getTextCollector() {
118 return textCollector;
119 }
120 public Text getTextCollectorNumber() {
121 return textCollectorNumber;
122 }
123 public Text getTextAccessionNumber() {
124 return textAccessionNumber;
125 }
126 public Text getTextHerbarium() {
127 return textHerbarium;
128 }
129 public Text getTextCountry() {
130 return textCountry;
131 }
132 public Text getTextLocality() {
133 return textLocality;
134 }
135 }