]> gerrit.simantics Code Review - simantics/district.git/blob
69ac4bc759c9382d7f6e1a97f11f3188e0f1c94a
[simantics/district.git] /
1 package org.simantics.maps.elevation.server.ui;
2
3 import org.eclipse.core.runtime.preferences.InstanceScope;
4 import org.eclipse.jface.layout.GridDataFactory;
5 import org.eclipse.jface.layout.GridLayoutFactory;
6 import org.eclipse.jface.preference.BooleanFieldEditor;
7 import org.eclipse.jface.preference.FieldEditorPreferencePage;
8 import org.eclipse.jface.preference.IPreferenceStore;
9 import org.eclipse.swt.SWT;
10 import org.eclipse.swt.widgets.Group;
11 import org.eclipse.ui.IWorkbench;
12 import org.eclipse.ui.IWorkbenchPreferencePage;
13 import org.eclipse.ui.preferences.ScopedPreferenceStore;
14 import org.simantics.maps.elevation.server.prefs.MapsElevationServerPreferences;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 public class MapsElevationServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
19
20     private static final Logger LOGGER = LoggerFactory.getLogger(MapsElevationServerPreferencePage.class);
21     
22     public MapsElevationServerPreferencePage() {
23         super(GRID);
24         setDescription("Maps elevation server preferences");
25     }
26
27     @Override
28     protected IPreferenceStore doGetPreferenceStore() {
29         return new ScopedPreferenceStore(InstanceScope.INSTANCE, MapsElevationServerPreferences.P_NODE);
30     }
31
32     private void createGeneralGroup() {
33         Group serverGroup = new Group(getFieldEditorParent(), SWT.NONE);
34         serverGroup.setText("General");
35         GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(serverGroup);
36
37         BooleanFieldEditor automatically = new BooleanFieldEditor(MapsElevationServerPreferences.P_USE_ELEVATION_SERVER, "Use elevation server", serverGroup);
38         addField(automatically);
39
40         GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(serverGroup);
41     }
42     
43     @Override
44     protected void createFieldEditors() {
45         createGeneralGroup();
46
47     }
48
49     @Override
50     protected void performApply() {
51         super.performApply();
52     }
53
54     @Override
55     public void init(IWorkbench workbench) {
56         
57     }
58
59
60 }