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
.ExpandableComposite
;
19 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
20 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
21 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
22 import org
.eclipse
.wb
.swt
.SWTResourceManager
;
24 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.EntitySelectionField
;
31 public class DerivedUnitDetailsElement
extends Composite
{
32 private final FormToolkit formToolkit
= new FormToolkit(Display
.getDefault());
33 private Text textBarcode
;
35 private Text txtNewText
;
38 * Create the composite.
42 public DerivedUnitDetailsElement(Composite parent
, int style
) {
44 setBackground(SWTResourceManager
.getColor(SWT
.COLOR_WHITE
));
46 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
47 tableWrapLayout
.numColumns
= 2;
48 setLayout(tableWrapLayout
);
51 Label lblBarcode
= formToolkit
.createLabel(this, "Barcode", SWT
.NONE
);
53 textBarcode
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
54 textBarcode
.setText("");
55 textBarcode
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
57 Label lblCatalognumber
= formToolkit
.createLabel(this, "CatalogNumber", SWT
.NONE
);
59 text_1
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
61 text_1
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
63 Label lblPreservationMethod
= formToolkit
.createLabel(this, "Preservation Method", SWT
.NONE
);
65 Combo combo
= new Combo(this, SWT
.NONE
);
66 combo
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
67 formToolkit
.adapt(combo
);
68 formToolkit
.paintBordersFor(combo
);
70 Label lblStoredUnder
= formToolkit
.createLabel(this, "Stored Under", SWT
.NONE
);
72 EntitySelectionField entitySelectionField
= new EntitySelectionField(this, SWT
.NONE
);
73 formToolkit
.adapt(entitySelectionField
);
74 formToolkit
.paintBordersFor(entitySelectionField
);
76 Label lblExsiccatum
= formToolkit
.createLabel(this, "Exsiccatum", SWT
.NONE
);
78 txtNewText
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
79 txtNewText
.setText("");
80 txtNewText
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
82 ExpandableComposite xpndblcmpstSources
= formToolkit
.createExpandableComposite(this, ExpandableComposite
.TWISTIE
);
83 xpndblcmpstSources
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.TOP
, 1, 2));
84 formToolkit
.paintBordersFor(xpndblcmpstSources
);
85 xpndblcmpstSources
.setText("Sources");
90 protected void checkSubclass() {
91 // Disable the check that prevents subclassing of SWT components