1 package org.simantics.maps.elevation.server.ui;
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;
18 public class MapsElevationServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
20 private static final Logger LOGGER = LoggerFactory.getLogger(MapsElevationServerPreferencePage.class);
22 public MapsElevationServerPreferencePage() {
24 setDescription("Maps elevation server preferences");
28 protected IPreferenceStore doGetPreferenceStore() {
29 return new ScopedPreferenceStore(InstanceScope.INSTANCE, MapsElevationServerPreferences.P_NODE);
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);
37 BooleanFieldEditor automatically = new BooleanFieldEditor(MapsElevationServerPreferences.P_USE_ELEVATION_SERVER, "Use elevation server", serverGroup);
38 addField(automatically);
40 GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(serverGroup);
44 protected void createFieldEditors() {
50 protected void performApply() {
55 public void init(IWorkbench workbench) {