Project

General

Profile

Download (3.13 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2014 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.mvc;
11

    
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;
21

    
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;
25

    
26
/**
27
 * @author pplitzner
28
 * @date 15.04.2014
29
 *
30
 */
31
public class GeographicPointElement extends AbstractCdmComposite {
32

    
33
    private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
34

    
35
    /**
36
     * Create the composite.
37
     * @param parent
38
     * @param style
39
     */
40
    public GeographicPointElement(Composite parent, int style) {
41
        super(parent, style);
42
        addDisposeListener(new DisposeListener() {
43
            @Override
44
            public void widgetDisposed(DisposeEvent e) {
45
                toolkit.dispose();
46
            }
47
        });
48
        toolkit.adapt(this);
49
        toolkit.paintBordersFor(this);
50
        {
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);
60
        }
61

    
62
        Label lblLatitude = toolkit.createLabel(this, "Latitude", SWT.NONE);
63
        new Label(this, SWT.NONE);
64

    
65
        Label lblLongitude = toolkit.createLabel(this, "Longitude", SWT.NONE);
66
        new Label(this, SWT.NONE);
67

    
68
        Label lblErrorRadius = toolkit.createLabel(this, "Error Radius", SWT.NONE);
69

    
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);
76

    
77
        Label lblReferenceSystem = toolkit.createLabel(this, "Reference System", SWT.NONE);
78

    
79
    }
80

    
81
    /* (non-Javadoc)
82
     * @see eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite#initInternalController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
83
     */
84
    @Override
85
    protected void initInternalController(CdmFormFactory formFactory, ICdmFormElement parentElement) {
86

    
87
    }
88

    
89
}
(3-3/3)