From 75a7c9fe13994ae5c8654d49f740e08043e90911 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Fri, 1 Jun 2007 14:00:47 +0000 Subject: [PATCH] [180671] Xuan's patch for checking if the file need to be re-downloaded even if file has been opened --- .../ui/view/SystemViewRemoteFileAdapter.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) 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 a5292da1240..b12d79ea747 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 @@ -22,6 +22,7 @@ * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186997] No deferred queries in Local Files * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core + * Xuan Chen (IBM) - [180671] [refresh] It is not possible to refresh editor with double clicking on it ********************************************************************************/ package org.eclipse.rse.internal.files.ui.view; @@ -2827,23 +2828,22 @@ public class SystemViewRemoteFileAdapter { try { - if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.OPEN_IN_SAME_PERSPECTIVE) - { - if (isFileCached(editable, remoteFile)) - { - editable.openEditor(); - } - else - { - DownloadJob oJob = new DownloadJob(editable, false); - oJob.schedule(); - } + boolean openedInSamePerspective = (editable.checkOpenInEditor() == ISystemEditableRemoteObject.OPEN_IN_SAME_PERSPECTIVE); + boolean isFileCached = isFileCached(editable, remoteFile); + if (isFileCached) + { + editable.openEditor(); } else { - editable.setLocalResourceProperties(); - editable.openEditor(); + DownloadJob oJob = new DownloadJob(editable, false); + oJob.schedule(); } + if (openedInSamePerspective && isFileCached) + { + editable.setLocalResourceProperties(); + } + } catch (Exception e) {