]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / src / org / simantics / district / maps / server / prefs / MapsServerPreferences.java
1 package org.simantics.district.maps.server.prefs;
2
3 import org.eclipse.core.runtime.preferences.DefaultScope;
4 import org.osgi.service.prefs.Preferences;
5 //import org.simantics.maps.server.ui.Activator;
6 import org.simantics.district.maps.server.Activator;
7
8 public class MapsServerPreferences {
9
10     public static final String P_NODE = Activator.PLUGIN_ID;
11     
12     public static final String P_START_AUTOMATICALLY = "org.simantics.maps.server.startAutomatically";
13
14     public static final String P_DEFAULT_PORT = "org.simantics.maps.server.defaultPort";
15
16     public static Preferences getPreferences() {
17         return DefaultScope.INSTANCE.getNode(MapsServerPreferences.P_NODE);
18     }
19     
20     public static boolean startAutomatically() {
21         return getPreferences().getBoolean(P_START_AUTOMATICALLY, true);
22     }
23
24     public static int defaultPort() {
25         return getPreferences().getInt(P_DEFAULT_PORT, 8080);
26     }
27
28 }