package org.simantics.district.maps.server.prefs; import org.eclipse.core.runtime.preferences.InstanceScope; import org.osgi.service.prefs.Preferences; import org.simantics.district.maps.server.Activator; public class MapsServerPreferences { public static final String P_NODE = Activator.PLUGIN_ID; public static final String P_START_AUTOMATICALLY = "org.simantics.maps.server.startAutomatically"; public static final String P_DEFAULT_PORT = "org.simantics.maps.server.defaultPort"; public static final String P_CURRENT_MBTILES = "org.simantics.maps.server.currentMbTiles"; public static final String P_CURRENT_TM2STYLE = "org.simantics.maps.server.currentTM2Style"; public static Preferences getPreferences() { return InstanceScope.INSTANCE.getNode(MapsServerPreferences.P_NODE); } public static boolean startAutomatically() { return getPreferences().getBoolean(P_START_AUTOMATICALLY, true); } public static int defaultPort() { return getPreferences().getInt(P_DEFAULT_PORT, 8080); } public static String currentMBTiles() { return getPreferences().get(P_CURRENT_MBTILES, ""); } public static String currentTM2Style() { return getPreferences().get(P_CURRENT_TM2STYLE, ""); } }