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
;
28 public class SpecimenDetailsElement
extends Composite
{
29 private final FormToolkit formToolkit
= new FormToolkit(Display
.getDefault());
30 private Text text_IndividualEcology
;
31 private Text text_PlantDesriptionDetails
;
32 private Text text_IndividualFieldNotes
;
33 private Combo comboLiveStage
;
34 private Combo combo_Sex
;
37 * Create the composite.
41 public SpecimenDetailsElement(Composite parent
, int style
) {
43 setBackground(SWTResourceManager
.getColor(SWT
.COLOR_WHITE
));
45 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
46 tableWrapLayout
.numColumns
= 2;
47 setLayout(tableWrapLayout
);
50 Label lblNewLabel
= formToolkit
.createLabel(this, "Individual Ecology", SWT
.NONE
);
52 text_IndividualEcology
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
53 text_IndividualEcology
.setText("");
54 text_IndividualEcology
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
56 Label lblPlantDescriptionDetails
= formToolkit
.createLabel(this, "Plant Description Details", SWT
.NONE
);
58 text_PlantDesriptionDetails
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
59 text_PlantDesriptionDetails
.setText("");
60 text_PlantDesriptionDetails
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
62 Label lblIndividualFieldNotes
= formToolkit
.createLabel(this, "Individual Field Notes", SWT
.NONE
);
64 text_IndividualFieldNotes
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
65 text_IndividualFieldNotes
.setText("");
66 text_IndividualFieldNotes
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
68 Label lblLiveStage
= formToolkit
.createLabel(this, "Live Stage", SWT
.NONE
);
70 comboLiveStage
= new Combo(this, SWT
.NONE
);
71 comboLiveStage
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
72 formToolkit
.adapt(comboLiveStage
);
73 formToolkit
.paintBordersFor(comboLiveStage
);
75 Label lblSex
= formToolkit
.createLabel(this, "Sex", SWT
.NONE
);
77 combo_Sex
= new Combo(this, SWT
.NONE
);
78 combo_Sex
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
79 formToolkit
.adapt(combo_Sex
);
80 formToolkit
.paintBordersFor(combo_Sex
);
85 protected void checkSubclass() {
86 // Disable the check that prevents subclassing of SWT components
89 public Text
getText_IndividualEcology() {
90 return text_IndividualEcology
;
92 public Text
getText_PlantDesriptionDetails() {
93 return text_PlantDesriptionDetails
;
95 public Text
getText_IndividualFieldNotes() {
96 return text_IndividualFieldNotes
;
98 public Combo
getComboLiveStage() {
99 return comboLiveStage
;
101 public Combo
getCombo_Sex() {