b88d472a306ba573206c1a7ac5157bfc0947f0fd
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / campanula / FieldObservationDetailsView.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.section.campanula;
11
12 import org.eclipse.swt.SWT;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Display;
15 import org.eclipse.ui.forms.widgets.ExpandableComposite;
16 import org.eclipse.ui.forms.widgets.FormToolkit;
17 import org.eclipse.ui.forms.widgets.TableWrapData;
18 import org.eclipse.ui.forms.widgets.TableWrapLayout;
19 import org.eclipse.wb.swt.SWTResourceManager;
20
21 /**
22 * @author pplitzner
23 * @date 07.08.2013
24 *
25 */
26 public class FieldObservationDetailsView extends Composite {
27 private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
28
29 /**
30 * Create the composite.
31 * @param parent
32 * @param style
33 */
34 public FieldObservationDetailsView(Composite parent, int style) {
35 super(parent, style);
36 setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
37 {
38 TableWrapLayout tableWrapLayout = new TableWrapLayout();
39 tableWrapLayout.numColumns = 1;
40 setLayout(tableWrapLayout);
41 }
42
43 ExpandableComposite xpndblcmpstNewExpandablecomposite = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
44 TableWrapData twd_xpndblcmpstNewExpandablecomposite = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
45 twd_xpndblcmpstNewExpandablecomposite.grabHorizontal = true;
46 xpndblcmpstNewExpandablecomposite.setLayoutData(twd_xpndblcmpstNewExpandablecomposite);
47 formToolkit.paintBordersFor(xpndblcmpstNewExpandablecomposite);
48 xpndblcmpstNewExpandablecomposite.setText("FieldObservation");
49 xpndblcmpstNewExpandablecomposite.setExpanded(true);
50
51 FieldObservationGeneralElement fieldObservationGeneralElement = new FieldObservationGeneralElement(xpndblcmpstNewExpandablecomposite, SWT.NONE);
52 formToolkit.adapt(fieldObservationGeneralElement);
53 formToolkit.paintBordersFor(fieldObservationGeneralElement);
54 xpndblcmpstNewExpandablecomposite.setClient(fieldObservationGeneralElement);
55
56 ExpandableComposite xpndblcmpstNewExpandablecomposite_1 = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
57 TableWrapData twd_xpndblcmpstNewExpandablecomposite_1 = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
58 twd_xpndblcmpstNewExpandablecomposite_1.grabHorizontal = true;
59 xpndblcmpstNewExpandablecomposite_1.setLayoutData(twd_xpndblcmpstNewExpandablecomposite_1);
60 formToolkit.paintBordersFor(xpndblcmpstNewExpandablecomposite_1);
61 xpndblcmpstNewExpandablecomposite_1.setText("Gathering Event Details");
62 xpndblcmpstNewExpandablecomposite_1.setExpanded(true);
63
64 GatheringEventDetailsElement gatheringEventDetailsElement = new GatheringEventDetailsElement(xpndblcmpstNewExpandablecomposite_1, SWT.NONE);
65 formToolkit.adapt(gatheringEventDetailsElement);
66 formToolkit.paintBordersFor(gatheringEventDetailsElement);
67 xpndblcmpstNewExpandablecomposite_1.setClient(gatheringEventDetailsElement);
68
69 ExpandableComposite xpndblcmpstNewExpandablecomposite_2 = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
70 TableWrapData twd_xpndblcmpstNewExpandablecomposite_2 = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
71 twd_xpndblcmpstNewExpandablecomposite_2.grabHorizontal = true;
72 xpndblcmpstNewExpandablecomposite_2.setLayoutData(twd_xpndblcmpstNewExpandablecomposite_2);
73 formToolkit.paintBordersFor(xpndblcmpstNewExpandablecomposite_2);
74 xpndblcmpstNewExpandablecomposite_2.setText("Collecting Areas");
75
76 ExpandableComposite xpndblcmpstFieldObservationDetails = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
77 TableWrapData twd_xpndblcmpstFieldObservationDetails = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
78 twd_xpndblcmpstFieldObservationDetails.grabHorizontal = true;
79 xpndblcmpstFieldObservationDetails.setLayoutData(twd_xpndblcmpstFieldObservationDetails);
80 formToolkit.paintBordersFor(xpndblcmpstFieldObservationDetails);
81 xpndblcmpstFieldObservationDetails.setText("Field Observation Details");
82
83 }
84
85 @Override
86 protected void checkSubclass() {
87 // Disable the check that prevents subclassing of SWT components
88 }
89 }