Project

General

Profile

Download (3.12 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2014 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
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.
8
*/
9
package eu.etaxonomy.taxeditor.ui.mvc;
10

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

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

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

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

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

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

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

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

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

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

    
78
    }
79

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

    
86
    }
87

    
88
}
(3-3/3)