diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java index ba52eb681f3..940090119e1 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java @@ -20,6 +20,7 @@ * David McKnight (IBM) - [205297] Editor upload should not be on main thread * David McKnight (IBM) - [195285] mount path mapper changes * Kevin Doyle (IBM) - [197976] Synch up Read-Only attribute when performing save based on local copy + * Kevin Doyle (IBM) - [204810] Saving file in Eclipse does not update remote file ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -46,6 +47,7 @@ import org.eclipse.rse.ui.actions.DisplaySystemMessageAction; import org.eclipse.rse.ui.view.ISystemEditableRemoteObject; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PartInitException; /** * This class manages listening for resource changes within our temp file project @@ -204,17 +206,25 @@ public class SystemUniversalTempFileListener extends SystemTempFileListener editable = new SystemEditableRemoteFile(remoteFile); } - // defect - we get a save event when saving during a close - // in that case, we shouldn't reopen the editor - // I think this was originally here so that, if a save is done on - // a file that hasn't yet been wrapped with an editable, we can - // set the editor member - // now call check method before - if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.NOT_OPEN) - { - editable.openEditor(); - } - editable.addAsListener(); + final SystemEditableRemoteFile fEditable = editable; + Display.getDefault().asyncExec(new Runnable() { + public void run() { + try { + // defect - we get a save event when saving during a close + // in that case, we shouldn't reopen the editor + // I think this was originally here so that, if a save is done on + // a file that hasn't yet been wrapped with an editable, we can + // set the editor member + // now call check method before + if (fEditable.checkOpenInEditor() != ISystemEditableRemoteObject.NOT_OPEN) + { + fEditable.openEditor(); + } + fEditable.addAsListener(); + } catch (PartInitException e) { + } + } + }); editable.setLocalResourceProperties(); } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java index 91b201d9f04..8fd09c4ce01 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java @@ -31,6 +31,7 @@ * David McKnight (IBM) - [199568] Removing synchronized from internalGetChildren * Kevin Doyle (IBM) - [197855] Can't Delete/Rename/Move a Read-Only File * Xuan Chen (IBM) - [202949] [archives] copy a folder from one connection to an archive file in a different connection does not work + * Kevin Doyle (IBM) - [204810] Saving file in Eclipse does not update remote file ********************************************************************************/ package org.eclipse.rse.internal.files.ui.view; @@ -2850,6 +2851,7 @@ public class SystemViewRemoteFileAdapter { editable.setLocalResourceProperties(); } + editable.addAsListener(); editable.openEditor(); } else