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
.section
.campanula
;
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 GatheringEventDetailsElement
extends Composite
{
28 private final FormToolkit formToolkit
= new FormToolkit(Display
.getDefault());
29 private final Text textElevationError
;
30 private final Text text_ElevationMinimum
;
31 private final Text text_ElevationMaximum
;
32 private final Text text_CollectingMethod
;
33 private final Text text_DistanceToGround
;
34 private final Text text_DistanceToWaterSurface
;
35 private final Text text_GatheringEventDescription
;
38 * Create the composite.
42 public GatheringEventDetailsElement(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 lblElevationError
= formToolkit
.createLabel(this, "Elevation Error", SWT
.NONE
);
53 textElevationError
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
54 textElevationError
.setText("");
55 textElevationError
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
57 Label lblElevationMinimumm
= formToolkit
.createLabel(this, "Elevation Minimum (m)", SWT
.NONE
);
59 text_ElevationMinimum
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
60 text_ElevationMinimum
.setText("");
61 text_ElevationMinimum
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
63 Label lblElevationMaximumm
= formToolkit
.createLabel(this, "Elevation Maximum (m)", SWT
.NONE
);
65 text_ElevationMaximum
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
66 text_ElevationMaximum
.setText("");
67 text_ElevationMaximum
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
69 Label lblCollectingMethod
= formToolkit
.createLabel(this, "Collecting Method", SWT
.NONE
);
71 text_CollectingMethod
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
72 text_CollectingMethod
.setText("");
73 text_CollectingMethod
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
75 Label lblDistanceToGround
= formToolkit
.createLabel(this, "Distance To Ground (m)", SWT
.NONE
);
77 text_DistanceToGround
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
78 text_DistanceToGround
.setText("");
79 text_DistanceToGround
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
81 Label lblDistanceToWater
= formToolkit
.createLabel(this, "Distance To Water Surface (m)", SWT
.NONE
);
83 text_DistanceToWaterSurface
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
84 text_DistanceToWaterSurface
.setText("");
85 text_DistanceToWaterSurface
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
87 Label lblGatheringEventDescription
= formToolkit
.createLabel(this, "Gathering Event Description", SWT
.NONE
);
89 text_GatheringEventDescription
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
90 text_GatheringEventDescription
.setText("");
91 text_GatheringEventDescription
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
96 protected void checkSubclass() {
97 // Disable the check that prevents subclassing of SWT components
100 public Text
getTextElevationError() {
101 return textElevationError
;
103 public Text
getText_ElevationMinimum() {
104 return text_ElevationMinimum
;
106 public Text
getText_ElevationMaximum() {
107 return text_ElevationMaximum
;
109 public Text
getText_CollectingMethod() {
110 return text_CollectingMethod
;
112 public Text
getText_DistanceToGround() {
113 return text_DistanceToGround
;
115 public Text
getText_DistanceToWaterSurface() {
116 return text_DistanceToWaterSurface
;
118 public Text
getText_GatheringEventDescription() {
119 return text_GatheringEventDescription
;