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.view.specimenSearch;
|
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.Button;
|
16
|
import org.eclipse.swt.widgets.Composite;
|
17
|
import org.eclipse.swt.widgets.Display;
|
18
|
import org.eclipse.swt.widgets.Label;
|
19
|
import org.eclipse.swt.widgets.Text;
|
20
|
import org.eclipse.ui.forms.widgets.FormToolkit;
|
21
|
import org.eclipse.ui.forms.widgets.TableWrapData;
|
22
|
import org.eclipse.ui.forms.widgets.TableWrapLayout;
|
23
|
|
24
|
/**
|
25
|
* @author pplitzner
|
26
|
* @date 22.05.2014
|
27
|
*
|
28
|
*/
|
29
|
public class SpecimenProviderSelectionComposite extends Composite {
|
30
|
|
31
|
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
|
32
|
private final Text txtAccessPoint;
|
33
|
private final Button btnGbif;
|
34
|
private final Button btnBioCaseProvider;
|
35
|
private final Label lblAccessPointUrl;
|
36
|
|
37
|
/**
|
38
|
* Create the composite.
|
39
|
* @param parent
|
40
|
* @param style
|
41
|
*/
|
42
|
public SpecimenProviderSelectionComposite(Composite parent, int style) {
|
43
|
super(parent, style);
|
44
|
addDisposeListener(new DisposeListener() {
|
45
|
@Override
|
46
|
public void widgetDisposed(DisposeEvent e) {
|
47
|
toolkit.dispose();
|
48
|
}
|
49
|
});
|
50
|
toolkit.adapt(this);
|
51
|
toolkit.paintBordersFor(this);
|
52
|
{
|
53
|
TableWrapLayout tableWrapLayout = new TableWrapLayout();
|
54
|
tableWrapLayout.numColumns = 2;
|
55
|
setLayout(tableWrapLayout);
|
56
|
}
|
57
|
|
58
|
btnGbif = new Button(this, SWT.RADIO);
|
59
|
toolkit.adapt(btnGbif, true, true);
|
60
|
btnGbif.setText("GBIF");
|
61
|
new Label(this, SWT.NONE);
|
62
|
|
63
|
btnBioCaseProvider = new Button(this, SWT.RADIO);
|
64
|
toolkit.adapt(btnBioCaseProvider, true, true);
|
65
|
btnBioCaseProvider.setText("BioCASE Provider");
|
66
|
new Label(this, SWT.NONE);
|
67
|
|
68
|
txtAccessPoint = new Text(this, SWT.BORDER);
|
69
|
txtAccessPoint.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
|
70
|
toolkit.adapt(txtAccessPoint, true, true);
|
71
|
|
72
|
lblAccessPointUrl = new Label(this, SWT.NONE);
|
73
|
lblAccessPointUrl.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
|
74
|
toolkit.adapt(lblAccessPointUrl, true, true);
|
75
|
lblAccessPointUrl.setText("Access Point URL");
|
76
|
|
77
|
}
|
78
|
|
79
|
public Button getBtnGbif() {
|
80
|
return btnGbif;
|
81
|
}
|
82
|
public Button getBtnBioCaseProvider() {
|
83
|
return btnBioCaseProvider;
|
84
|
}
|
85
|
public Text getTxtAccessPoint() {
|
86
|
return txtAccessPoint;
|
87
|
}
|
88
|
public Label getLblAccessPointUrl() {
|
89
|
return lblAccessPointUrl;
|
90
|
}
|
91
|
}
|