82096fcf287c32a3bd03ce590b16b8def37192f2
[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.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;
23
24 import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionField;
25
26 /**
27 * @author pplitzner
28 * @date 29.08.2013
29 *
30 */
31 public class DerivedUnitDetailsElement extends Composite {
32 private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
33 private Text textBarcode;
34 private Text text_1;
35 private Text txtNewText;
36
37 /**
38 * Create the composite.
39 * @param parent
40 * @param style
41 */
42 public DerivedUnitDetailsElement(Composite parent, int style) {
43 super(parent, style);
44 setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
45 {
46 TableWrapLayout tableWrapLayout = new TableWrapLayout();
47 tableWrapLayout.numColumns = 2;
48 setLayout(tableWrapLayout);
49 }
50
51 Label lblBarcode = formToolkit.createLabel(this, "Barcode", SWT.NONE);
52
53 textBarcode = formToolkit.createText(this, "New Text", SWT.NONE);
54 textBarcode.setText("");
55 textBarcode.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
56
57 Label lblCatalognumber = formToolkit.createLabel(this, "CatalogNumber", SWT.NONE);
58
59 text_1 = formToolkit.createText(this, "New Text", SWT.NONE);
60 text_1.setText("");
61 text_1.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
62
63 Label lblPreservationMethod = formToolkit.createLabel(this, "Preservation Method", SWT.NONE);
64
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);
69
70 Label lblStoredUnder = formToolkit.createLabel(this, "Stored Under", SWT.NONE);
71
72 EntitySelectionField entitySelectionField = new EntitySelectionField(this, SWT.NONE);
73 formToolkit.adapt(entitySelectionField);
74 formToolkit.paintBordersFor(entitySelectionField);
75
76 Label lblExsiccatum = formToolkit.createLabel(this, "Exsiccatum", SWT.NONE);
77
78 txtNewText = formToolkit.createText(this, "New Text", SWT.NONE);
79 txtNewText.setText("");
80 txtNewText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
81
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");
86
87 }
88
89 @Override
90 protected void checkSubclass() {
91 // Disable the check that prevents subclassing of SWT components
92 }
93
94 }