]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.elevation.server/src/org/simantics/maps/elevation/server/prefs/MapsElevationServerPreferences.java
8db89308a0e4ff1fa2cc981a31e73d2da6fbc46a
[simantics/district.git] / org.simantics.maps.elevation.server / src / org / simantics / maps / elevation / server / prefs / MapsElevationServerPreferences.java
1 package org.simantics.maps.elevation.server.prefs;
2
3 import org.eclipse.core.runtime.preferences.InstanceScope;
4 import org.osgi.service.prefs.Preferences;
5 import org.simantics.maps.elevation.server.Activator;
6
7 public class MapsElevationServerPreferences {
8
9     public static final String P_NODE = Activator.PLUGIN_ID;
10
11     public static final String P_USE_ELEVATION_SERVER = "org.simantics.maps.elevation.server.useElevationServer";
12     public static final String P_PIPE_DEPTH_UNDER_GROUND = "org.simantics.maps.elevation.server.pipeDepthUnderGround";
13
14     public static Preferences getPreferences() {
15         return InstanceScope.INSTANCE.getNode(MapsElevationServerPreferences.P_NODE);
16     }
17
18     public static boolean useElevationServer() {
19         return getPreferences().getBoolean(P_USE_ELEVATION_SERVER, false);
20     }
21
22     public static int pipeDepthUnderGround() {
23         return getPreferences().getInt(P_PIPE_DEPTH_UNDER_GROUND, -1);
24     }
25 }