1
|
/**
|
2
|
* Copyright (C) 2019 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.preference;
|
10
|
|
11
|
import org.eclipse.jface.preference.IntegerFieldEditor;
|
12
|
import org.eclipse.jface.preference.StringFieldEditor;
|
13
|
import org.eclipse.swt.SWT;
|
14
|
import org.eclipse.swt.layout.GridData;
|
15
|
import org.eclipse.swt.widgets.Composite;
|
16
|
import org.eclipse.swt.widgets.Control;
|
17
|
import org.eclipse.swt.widgets.Label;
|
18
|
|
19
|
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.SpacerFieldEditor;
|
20
|
import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
|
21
|
|
22
|
/**
|
23
|
* @author k.luther
|
24
|
* @since 18.01.2019
|
25
|
*
|
26
|
*/
|
27
|
public class ExternalServicesPreferences extends FieldEditorPreferencePageE4 {
|
28
|
|
29
|
StringFieldEditor openUrl;
|
30
|
IntegerFieldEditor maxWidth;
|
31
|
IntegerFieldEditor maxHeight;
|
32
|
|
33
|
StringFieldEditor mapService;
|
34
|
|
35
|
|
36
|
/**
|
37
|
* {@inheritDoc}
|
38
|
*/
|
39
|
@Override
|
40
|
protected void createFieldEditors() {
|
41
|
addField(new StringFieldEditor(
|
42
|
PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_ACCESS_POINT),
|
43
|
"Mobot Open Url Service Access Point:", getFieldEditorParent()));
|
44
|
addField(new IntegerFieldEditor(
|
45
|
PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH),
|
46
|
"Image Maximum Width:",
|
47
|
getFieldEditorParent()));
|
48
|
addField(new IntegerFieldEditor(
|
49
|
PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT),
|
50
|
"Image Maximum Height:",
|
51
|
getFieldEditorParent()));
|
52
|
SpacerFieldEditor spacer1 = new SpacerFieldEditor(
|
53
|
getFieldEditorParent());
|
54
|
|
55
|
addField(new StringFieldEditor(PreferencesUtil.createPreferenceString(
|
56
|
IPreferenceKeys.EDIT_MAP_SERVICE_ACCES_POINT),
|
57
|
"EDIT Map Service Access Point:", getFieldEditorParent()));
|
58
|
|
59
|
}
|
60
|
|
61
|
|
62
|
|
63
|
|
64
|
@Override
|
65
|
protected Control createContents(Composite parent) {
|
66
|
Composite top = new Composite(parent, SWT.LEFT);
|
67
|
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
|
68
|
|
69
|
top.setLayoutData(gridData);
|
70
|
Label mobot = new Label(top, SWT.NULL);
|
71
|
mobot.setText("Mobot Open Url Service");
|
72
|
GridData gridDataLabel = new GridData(GridData.FILL_HORIZONTAL);
|
73
|
gridDataLabel.horizontalSpan=2;
|
74
|
mobot.setLayoutData(gridDataLabel);
|
75
|
openUrl = new StringFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_ACCESS_POINT),
|
76
|
"Access Point:", top);
|
77
|
openUrl.setPreferenceStore(getPreferenceStore());
|
78
|
openUrl.load();
|
79
|
Label reference = new Label(top, SWT.NULL);
|
80
|
reference.setText("BHL Reference Image");
|
81
|
|
82
|
reference.setLayoutData(gridDataLabel);
|
83
|
maxWidth = new IntegerFieldEditor(
|
84
|
PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH),
|
85
|
"Maximum Width",
|
86
|
top);
|
87
|
maxWidth.setPreferenceStore(getPreferenceStore());
|
88
|
maxWidth.load();
|
89
|
|
90
|
maxHeight = new IntegerFieldEditor(
|
91
|
PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT),
|
92
|
"Maximum Height",
|
93
|
top);
|
94
|
maxHeight.setPreferenceStore(getPreferenceStore());
|
95
|
maxHeight.load();
|
96
|
Label mapServiceLabel = new Label(top, SWT.NULL);
|
97
|
mapServiceLabel.setText("EDIT Map Service:");
|
98
|
mapServiceLabel.setLayoutData(gridDataLabel);
|
99
|
mapService = new StringFieldEditor(PreferencesUtil.createPreferenceString(
|
100
|
IPreferenceKeys.EDIT_MAP_SERVICE_ACCES_POINT),
|
101
|
"Access Point", top);
|
102
|
mapService.setPreferenceStore(getPreferenceStore());
|
103
|
mapService.load();
|
104
|
return top;
|
105
|
|
106
|
}
|
107
|
|
108
|
|
109
|
}
|