Project

General

Profile

« Previous | Next » 

Revision ef85d9e0

Added by Katja Luther about 5 years ago

ref #7163: group Mobot preferences

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java
8 8
*/
9 9
package eu.etaxonomy.taxeditor.preference;
10 10

  
11
import org.eclipse.jface.layout.GridLayoutFactory;
11 12
import org.eclipse.jface.preference.IntegerFieldEditor;
12 13
import org.eclipse.jface.preference.StringFieldEditor;
13 14
import org.eclipse.swt.SWT;
......
16 17
import org.eclipse.swt.widgets.Control;
17 18
import org.eclipse.swt.widgets.Label;
18 19

  
19
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.SpacerFieldEditor;
20
import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
20
import eu.etaxonomy.taxeditor.l10n.Messages;
21
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
21 22

  
22 23
/**
23 24
 * @author k.luther
24 25
 * @since 18.01.2019
25 26
 *
26 27
 */
27
public class ExternalServicesPreferences extends FieldEditorPreferencePageE4 {
28
public class ExternalServicesPreferences extends CdmPreferencePage {
28 29

  
29 30
    StringFieldEditor openUrl;
30 31
    IntegerFieldEditor maxWidth;
......
33 34
    StringFieldEditor mapService;
34 35

  
35 36

  
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 37

  
64 38
    @Override
65 39
    protected Control createContents(Composite parent) {
66 40
       Composite top = new Composite(parent, SWT.LEFT);
67 41
       GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
68

  
42
       GridLayoutFactory.fillDefaults().applyTo(top);
69 43
       top.setLayoutData(gridData);
70 44
       Label mobot = new Label(top, SWT.NULL);
71
       mobot.setText("Mobot Open Url Service");
45
       mobot.setText("Mobot Open Url Service"); //$NON-NLS-1$
72 46
       GridData gridDataLabel = new GridData(GridData.FILL_HORIZONTAL);
73 47
       gridDataLabel.horizontalSpan=2;
48

  
74 49
       mobot.setLayoutData(gridDataLabel);
50

  
51
       Composite mobotComp = new Composite(top, SWT.NULL);
52

  
53
       GridLayoutFactory.fillDefaults().applyTo(mobotComp);
54

  
55
       GridData data = new GridData();
56
       data.horizontalIndent = 5;
57
       data.horizontalSpan = 2;
58
       mobotComp.setLayoutData(data);
59

  
60

  
75 61
       openUrl = new StringFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_ACCESS_POINT),
76
               "Access Point:", top);
62
               "Access Point", mobotComp); //$NON-NLS-1$
77 63
       openUrl.setPreferenceStore(getPreferenceStore());
78 64
       openUrl.load();
79
       Label reference = new Label(top, SWT.NULL);
80
       reference.setText("BHL Reference Image");
65

  
66
       Label reference = new Label(mobotComp, SWT.NULL);
67
       reference.setText("BHL Reference Image"); //$NON-NLS-1$
81 68

  
82 69
       reference.setLayoutData(gridDataLabel);
83 70
       maxWidth = new IntegerFieldEditor(
84 71
               PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH),
85
               "Maximum Width",
86
               top);
72
               Messages.ExternalServicesPreferences_max_width,
73
               mobotComp);
87 74
       maxWidth.setPreferenceStore(getPreferenceStore());
88 75
       maxWidth.load();
89 76

  
90 77
       maxHeight = new IntegerFieldEditor(
91 78
               PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT),
92
               "Maximum Height",
93
               top);
79
               Messages.ExternalServicesPreferences_max_height,
80
               mobotComp);
94 81
       maxHeight.setPreferenceStore(getPreferenceStore());
95 82
       maxHeight.load();
83
       Label separator= new Label(top, SWT.HORIZONTAL | SWT.SEPARATOR);
84
       GridData sepGrid = createTextGridData();
85
       separator.setLayoutData(sepGrid);
86

  
87

  
88

  
96 89
       Label mapServiceLabel = new Label(top, SWT.NULL);
97
       mapServiceLabel.setText("EDIT Map Service:");
90
       mapServiceLabel.setText("EDIT Map Service"); //$NON-NLS-1$
98 91
       mapServiceLabel.setLayoutData(gridDataLabel);
92

  
99 93
       mapService = new StringFieldEditor(PreferencesUtil.createPreferenceString(
100 94
               IPreferenceKeys.EDIT_MAP_SERVICE_ACCES_POINT),
101
               "Access Point", top);
95
               "Access Point", top); //$NON-NLS-1$
102 96
       mapService.setPreferenceStore(getPreferenceStore());
103 97
       mapService.load();
98

  
99
       parent.layout();
100

  
104 101
       return top;
105 102

  
106 103
    }

Also available in: Unified diff