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
.ui
.campanula
.detailViews
.specimen
;
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
;
23 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.EntitySelectionField
;
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
;
39 * Create the composite.
43 public DerivedUnitDetailsElement(Composite parent
, int style
) {
45 setBackground(SWTResourceManager
.getColor(SWT
.COLOR_WHITE
));
47 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
48 tableWrapLayout
.numColumns
= 2;
49 setLayout(tableWrapLayout
);
52 Label lblBarcode
= formToolkit
.createLabel(this, "Barcode", SWT
.NONE
);
54 textBarcode
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
55 textBarcode
.setText("");
56 textBarcode
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
58 Label lblCatalognumber
= formToolkit
.createLabel(this, "CatalogNumber", SWT
.NONE
);
60 textCatalogNumber
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
61 textCatalogNumber
.setText("");
62 textCatalogNumber
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
64 Label lblPreservationMethod
= formToolkit
.createLabel(this, "Preservation Method", SWT
.NONE
);
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
);
71 Label lblStoredUnder
= formToolkit
.createLabel(this, "Stored Under", SWT
.NONE
);
73 storedUnderSelectionField
= new EntitySelectionField(this, SWT
.NONE
);
74 formToolkit
.adapt(storedUnderSelectionField
);
75 formToolkit
.paintBordersFor(storedUnderSelectionField
);
77 Label lblExsiccatum
= formToolkit
.createLabel(this, "Exsiccatum", SWT
.NONE
);
79 txtExsiccatum
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
80 txtExsiccatum
.setText("");
81 txtExsiccatum
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
86 protected void checkSubclass() {
87 // Disable the check that prevents subclassing of SWT components
90 public Text
getTextBarcode() {
93 public Text
getTextCatalogNumber() {
94 return textCatalogNumber
;
96 public Combo
getComboPreservationMethod() {
97 return comboPreservationMethod
;
99 public EntitySelectionField
getStoredUnderSelectionField() {
100 return storedUnderSelectionField
;
102 public Text
getTxtExsiccatum() {
103 return txtExsiccatum
;