diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java index 0ff38c48d3a..ebf5ce25239 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java @@ -24,6 +24,7 @@ * David McKnight (IBM) - [225747] [dstore] Trying to connect to an "Offline" system throws an NPE * David McKnight (IBM) - [235221] Files truncated on exit of Eclipse * David McKnight (IBM) - [251631] NullPointerException in SystemTempFileListener + * David McKnight (IBM) - [256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property *******************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -684,28 +685,31 @@ public abstract class SystemTempFileListener implements IResourceChangeListener } // attempt the remote file synchronization - if (doesHandle(fs) && !fs.isOffline()) + if (doesHandle(fs)) { - // see if we're connected - try - { - // check that the remote file system is connected - // if not, attempt to connect to it - if (!fs.isConnected()) + if (!fs.isOffline()){ + // see if we're connected + try { - fs.connect(false, null); + // check that the remote file system is connected + // if not, attempt to connect to it + if (!fs.isConnected()) + { + // make sure we connect synchronously from here + fs.connect(monitor, false); + } + } + catch (Exception e) + { + // unable to connect to the remote server + // do not attempt synchronization + // instead, defer synchronization to later but allow user to edit + // set the dirty flag to indicate that this file needs resynchronization + properties.setDirty(true); + return; } } - catch (Exception e) - { - // unable to connect to the remote server - // do not attempt synchronization - // instead, defer synchronization to later but allow user to edit - // set the dirty flag to indicate that this file needs resynchronization - properties.setDirty(true); - return; - } - doResourceSynchronization(fs, file, uploadPath, monitor); + doResourceSynchronization(fs, file, uploadPath, monitor); } } } 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 35c0eb840be..f2f997826dc 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 @@ -24,6 +24,7 @@ * Kevin Doyle (IBM) - [210389] Display error dialog when setting file not read-only fails when saving * David McKnight (IBM) - [235221] Files truncated on exit of Eclipse * David McKnight (IBM) - [249544] Save conflict dialog appears when saving files in the editor + * David McKnight (IBM) - [256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -140,7 +141,17 @@ public class SystemUniversalTempFileListener extends SystemTempFileListener // make sure we're working online - not offline if (fs.isOffline()) { - properties.setDirty(true); + // offline mode - make sure the file stays dirty + properties.setDirty(true); + + // try to reset the dirty indicator for the editor if it's open + // will only work for lpex right now + SystemEditableRemoteFile editable = null; + if (properties.getRemoteFileObject() instanceof SystemEditableRemoteFile){ + editable = (SystemEditableRemoteFile)properties.getRemoteFileObject(); + editable.updateDirtyIndicator(); + } + return; } else