Merge "Omaha #5242 fix mistake when refreshing editor contents" into omaha_16.2.2
Former-commit-id: b809fe257555cfa929f88cad8dcb65e086ca3fe1
This commit is contained in:
commit
70d33e45eb
1 changed files with 8 additions and 8 deletions
|
@ -20,7 +20,6 @@
|
||||||
package com.raytheon.uf.viz.localization.perspective.view;
|
package com.raytheon.uf.viz.localization.perspective.view;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -96,7 +95,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.localization.SaveableOutputStream;
|
|
||||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
@ -1582,15 +1580,17 @@ public class FileTreeView extends ViewPart implements IPartListener2,
|
||||||
try {
|
try {
|
||||||
ILocalizationFile file = input
|
ILocalizationFile file = input
|
||||||
.getLocalizationFile();
|
.getLocalizationFile();
|
||||||
|
/*
|
||||||
|
* TODO can't easily replace the deprecated save()
|
||||||
|
* call because if we use openOutputStream() it will
|
||||||
|
* overwrite the file contents
|
||||||
|
*/
|
||||||
if (!file.getContext().getLocalizationLevel()
|
if (!file.getContext().getLocalizationLevel()
|
||||||
.isSystemLevel()) {
|
.isSystemLevel()
|
||||||
try (SaveableOutputStream sos = file
|
&& input.getLocalizationFile().save()) {
|
||||||
.openOutputStream()) {
|
|
||||||
sos.save();
|
|
||||||
}
|
|
||||||
input.refreshLocalizationFile();
|
input.refreshLocalizationFile();
|
||||||
}
|
}
|
||||||
} catch (LocalizationException | IOException e) {
|
} catch (LocalizationException e) {
|
||||||
statusHandler.handle(
|
statusHandler.handle(
|
||||||
Priority.PROBLEM,
|
Priority.PROBLEM,
|
||||||
"Error saving file: "
|
"Error saving file: "
|
||||||
|
|
Loading…
Add table
Reference in a new issue