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
.fieldObservation
;
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 import org
.eclipse
.wb
.swt
.SWTResourceManager
;
27 public class FieldObservationDetailsElement
extends Composite
{
28 private final FormToolkit formToolkit
= new FormToolkit(Display
.getDefault());
29 private Text text_ecology
;
30 private Text text_plantDescription
;
31 private Text text_FieldNotes
;
32 private Text text_IndividualCount
;
35 * Create the composite.
39 public FieldObservationDetailsElement(Composite parent
, int style
) {
41 setBackground(SWTResourceManager
.getColor(SWT
.COLOR_WHITE
));
43 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
44 tableWrapLayout
.numColumns
= 2;
45 tableWrapLayout
.verticalSpacing
= 0;
46 tableWrapLayout
.topMargin
= 0;
47 tableWrapLayout
.rightMargin
= 0;
48 tableWrapLayout
.leftMargin
= 0;
49 tableWrapLayout
.horizontalSpacing
= 0;
50 tableWrapLayout
.bottomMargin
= 0;
51 setLayout(tableWrapLayout
);
54 Label lblEcology
= formToolkit
.createLabel(this, "Ecology", SWT
.NONE
);
56 text_ecology
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
57 text_ecology
.setText("");
58 text_ecology
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
60 Label lblPlantDescription
= formToolkit
.createLabel(this, "Plant Description", SWT
.NONE
);
62 text_plantDescription
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
63 text_plantDescription
.setText("");
64 text_plantDescription
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
66 Label lblFieldNotes
= formToolkit
.createLabel(this, "Field Notes", SWT
.NONE
);
68 text_FieldNotes
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
69 text_FieldNotes
.setText("");
70 text_FieldNotes
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
72 Label lblIndividualCount
= formToolkit
.createLabel(this, "Individual Count", SWT
.NONE
);
74 text_IndividualCount
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
75 text_IndividualCount
.setText("");
76 text_IndividualCount
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
81 protected void checkSubclass() {
82 // Disable the check that prevents subclassing of SWT components
85 public Text
getText_ecology() {
88 public Text
getText_plantDescription() {
89 return text_plantDescription
;
91 public Text
getText_FieldNotes() {
92 return text_FieldNotes
;
94 public Text
getText_IndividualCount() {
95 return text_IndividualCount
;