2 * Copyright (C) 2014 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.ui
.mvc
;
11 import org
.eclipse
.swt
.SWT
;
12 import org
.eclipse
.swt
.events
.DisposeEvent
;
13 import org
.eclipse
.swt
.events
.DisposeListener
;
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
.ui
.forms
.widgets
.FormToolkit
;
18 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
19 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
23 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.TextWithLabelElementMVC
;
30 public class GeographicPointElement
extends AbstractCdmComposite
{
32 private final FormToolkit toolkit
= new FormToolkit(Display
.getCurrent());
35 * Create the composite.
39 public GeographicPointElement(Composite parent
, int style
) {
41 addDisposeListener(new DisposeListener() {
43 public void widgetDisposed(DisposeEvent e
) {
48 toolkit
.paintBordersFor(this);
50 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
51 tableWrapLayout
.verticalSpacing
= 0;
52 tableWrapLayout
.topMargin
= 0;
53 tableWrapLayout
.rightMargin
= 0;
54 tableWrapLayout
.leftMargin
= 0;
55 tableWrapLayout
.bottomMargin
= 0;
56 tableWrapLayout
.horizontalSpacing
= 0;
57 tableWrapLayout
.numColumns
= 2;
58 setLayout(tableWrapLayout
);
61 Label lblLatitude
= toolkit
.createLabel(this, "Latitude", SWT
.NONE
);
62 new Label(this, SWT
.NONE
);
64 Label lblLongitude
= toolkit
.createLabel(this, "Longitude", SWT
.NONE
);
65 new Label(this, SWT
.NONE
);
67 Label lblErrorRadius
= toolkit
.createLabel(this, "Error Radius", SWT
.NONE
);
69 TextWithLabelElementMVC textWithLabelElement
= new TextWithLabelElementMVC(this, (String
) null, (Integer
) null, 0);
70 TableWrapData twd_textWithLabelElement
= new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.TOP
, 1, 1);
71 twd_textWithLabelElement
.grabHorizontal
= true;
72 textWithLabelElement
.setLayoutData(twd_textWithLabelElement
);
73 toolkit
.adapt(textWithLabelElement
);
74 toolkit
.paintBordersFor(textWithLabelElement
);
76 Label lblReferenceSystem
= toolkit
.createLabel(this, "Reference System", SWT
.NONE
);
81 * @see eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite#initInternalController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
84 protected void initInternalController(CdmFormFactory formFactory
, ICdmFormElement parentElement
) {