- completed Specimen and FieldObservation view + wizards
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / campanula / detailViews / specimen / DerivedUnitDetailsElement.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.detailViews.specimen;
11
12 import org.eclipse.swt.SWT;
13 import org.eclipse.swt.widgets.Combo;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.swt.widgets.Display;
16 import org.eclipse.swt.widgets.Label;
17 import org.eclipse.swt.widgets.Text;
18 import org.eclipse.ui.forms.widgets.FormToolkit;
19 import org.eclipse.ui.forms.widgets.TableWrapData;
20 import org.eclipse.ui.forms.widgets.TableWrapLayout;
21 import org.eclipse.wb.swt.SWTResourceManager;
22
23 import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionField;
24
25 /**
26 * @author pplitzner
27 * @date 29.08.2013
28 *
29 */
30 public class DerivedUnitDetailsElement extends Composite {
31 private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
32 private Text textBarcode;
33 private Text textCatalogNumber;
34 private Text txtExsiccatum;
35 private Combo comboPreservationMethod;
36 private EntitySelectionField storedUnderSelectionField;
37
38 /**
39 * Create the composite.
40 * @param parent
41 * @param style
42 */
43 public DerivedUnitDetailsElement(Composite parent, int style) {
44 super(parent, style);
45 setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
46 {
47 TableWrapLayout tableWrapLayout = new TableWrapLayout();
48 tableWrapLayout.numColumns = 2;
49 setLayout(tableWrapLayout);
50 }
51
52 Label lblBarcode = formToolkit.createLabel(this, "Barcode", SWT.NONE);
53
54 textBarcode = formToolkit.createText(this, "New Text", SWT.NONE);
55 textBarcode.setText("");
56 textBarcode.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
57
58 Label lblCatalognumber = formToolkit.createLabel(this, "CatalogNumber", SWT.NONE);
59
60 textCatalogNumber = formToolkit.createText(this, "New Text", SWT.NONE);
61 textCatalogNumber.setText("");
62 textCatalogNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
63
64 Label lblPreservationMethod = formToolkit.createLabel(this, "Preservation Method", SWT.NONE);
65
66 comboPreservationMethod = new Combo(this, SWT.NONE);
67 comboPreservationMethod.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
68 formToolkit.adapt(comboPreservationMethod);
69 formToolkit.paintBordersFor(comboPreservationMethod);
70
71 Label lblStoredUnder = formToolkit.createLabel(this, "Stored Under", SWT.NONE);
72
73 storedUnderSelectionField = new EntitySelectionField(this, SWT.NONE);
74 formToolkit.adapt(storedUnderSelectionField);
75 formToolkit.paintBordersFor(storedUnderSelectionField);
76
77 Label lblExsiccatum = formToolkit.createLabel(this, "Exsiccatum", SWT.NONE);
78
79 txtExsiccatum = formToolkit.createText(this, "New Text", SWT.NONE);
80 txtExsiccatum.setText("");
81 txtExsiccatum.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
82
83 }
84
85 @Override
86 protected void checkSubclass() {
87 // Disable the check that prevents subclassing of SWT components
88 }
89
90 public Text getTextBarcode() {
91 return textBarcode;
92 }
93 public Text getTextCatalogNumber() {
94 return textCatalogNumber;
95 }
96 public Combo getComboPreservationMethod() {
97 return comboPreservationMethod;
98 }
99 public EntitySelectionField getStoredUnderSelectionField() {
100 return storedUnderSelectionField;
101 }
102 public Text getTxtExsiccatum() {
103 return txtExsiccatum;
104 }
105 }