X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.elevation.server.ui%2Fsrc%2Forg%2Fsimantics%2Fmaps%2Felevation%2Fserver%2Fui%2FMapsElevationServerPreferencePage.java;h=366ca0312303a08e566c71b61d3c9054037c534a;hb=47748e479895b9e74d805411f26c1d02601bf360;hp=a014c315aa02c094d4139f650233ea807d4fa443;hpb=76d4bb1c494a0d9059062baf2f3ba4b3559c3e19;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.elevation.server.ui/src/org/simantics/maps/elevation/server/ui/MapsElevationServerPreferencePage.java b/org.simantics.maps.elevation.server.ui/src/org/simantics/maps/elevation/server/ui/MapsElevationServerPreferencePage.java index a014c315..366ca031 100644 --- a/org.simantics.maps.elevation.server.ui/src/org/simantics/maps/elevation/server/ui/MapsElevationServerPreferencePage.java +++ b/org.simantics.maps.elevation.server.ui/src/org/simantics/maps/elevation/server/ui/MapsElevationServerPreferencePage.java @@ -7,11 +7,13 @@ import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Group; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.preferences.ScopedPreferenceStore; +import org.simantics.maps.elevation.server.SingletonTiffTileInterface; import org.simantics.maps.elevation.server.prefs.MapsElevationServerPreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,6 +40,9 @@ public class MapsElevationServerPreferencePage extends FieldEditorPreferencePage BooleanFieldEditor automatically = new BooleanFieldEditor(MapsElevationServerPreferences.P_USE_ELEVATION_SERVER, "Use elevation server", serverGroup); addField(automatically); + StringFieldEditor tifFolderPath = new StringFieldEditor(MapsElevationServerPreferences.P_TIFF_FOLDER_PATH, "Tiff folder path", serverGroup); + addField(tifFolderPath); + IntegerFieldEditor pipeDepth = new IntegerFieldEditor(MapsElevationServerPreferences.P_PIPE_DEPTH_UNDER_GROUND, "Pipe depth under ground", serverGroup); pipeDepth.setValidRange(Integer.MIN_VALUE, Integer.MAX_VALUE); addField(pipeDepth); @@ -55,6 +60,21 @@ public class MapsElevationServerPreferencePage extends FieldEditorPreferencePage protected void performApply() { super.performApply(); } + + @Override + public boolean performOk() { + boolean ok = super.performOk(); + if (ok) { + try { + SingletonTiffTileInterface.reloadElevationServer(); + } catch (Exception e) { + LOGGER.error("Could not reload elevation server", e); + setErrorMessage(e.getMessage()); + return false; + } + } + return ok; + } @Override public void init(IWorkbench workbench) {