3 * Copyright (C) 2014 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
.mvc
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.events
.DisposeEvent
;
14 import org
.eclipse
.swt
.events
.DisposeListener
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.swt
.widgets
.Display
;
17 import org
.eclipse
.swt
.widgets
.Label
;
18 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
19 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
20 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
23 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
24 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.TextWithLabelElementMVC
;
31 public class GeographicPointElement
extends AbstractCdmComposite
{
33 private final FormToolkit toolkit
= new FormToolkit(Display
.getCurrent());
36 * Create the composite.
40 public GeographicPointElement(Composite parent
, int style
) {
42 addDisposeListener(new DisposeListener() {
44 public void widgetDisposed(DisposeEvent e
) {
49 toolkit
.paintBordersFor(this);
51 TableWrapLayout tableWrapLayout
= new TableWrapLayout();
52 tableWrapLayout
.verticalSpacing
= 0;
53 tableWrapLayout
.topMargin
= 0;
54 tableWrapLayout
.rightMargin
= 0;
55 tableWrapLayout
.leftMargin
= 0;
56 tableWrapLayout
.bottomMargin
= 0;
57 tableWrapLayout
.horizontalSpacing
= 0;
58 tableWrapLayout
.numColumns
= 2;
59 setLayout(tableWrapLayout
);
62 Label lblLatitude
= toolkit
.createLabel(this, "Latitude", SWT
.NONE
);
63 new Label(this, SWT
.NONE
);
65 Label lblLongitude
= toolkit
.createLabel(this, "Longitude", SWT
.NONE
);
66 new Label(this, SWT
.NONE
);
68 Label lblErrorRadius
= toolkit
.createLabel(this, "Error Radius", SWT
.NONE
);
70 TextWithLabelElementMVC textWithLabelElement
= new TextWithLabelElementMVC(this, (String
) null, (Integer
) null, 0);
71 TableWrapData twd_textWithLabelElement
= new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.TOP
, 1, 1);
72 twd_textWithLabelElement
.grabHorizontal
= true;
73 textWithLabelElement
.setLayoutData(twd_textWithLabelElement
);
74 toolkit
.adapt(textWithLabelElement
);
75 toolkit
.paintBordersFor(textWithLabelElement
);
77 Label lblReferenceSystem
= toolkit
.createLabel(this, "Reference System", SWT
.NONE
);
82 * @see eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite#initInternalController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
85 protected void initInternalController(CdmFormFactory formFactory
, ICdmFormElement parentElement
) {