1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[234924] [ftp][dnd][Refresh] Copy/Paste file from Package Explorer doesn't refresh folder

This commit is contained in:
David McKnight 2008-06-02 20:21:48 +00:00
parent 74180bae8b
commit ad57112544
2 changed files with 48 additions and 11 deletions

View file

@ -47,6 +47,7 @@
* Rupen Mardirossian (IBM) - [198728] downloadResourcesToWorkspace now creates empty folders for copying across connections via createEmptyFolders method
* David McKnight (IBM) - [229610] [api] File transfers should use workspace text file encoding
* Kevin Doyle (IBM) - [227391] Saving file in Eclipse does not update remote file
* David McKnight (IBM) - [234924] [ftp][dnd][Refresh] Copy/Paste file from Package Explorer doesn't refresh folder
********************************************************************************/
package org.eclipse.rse.files.ui.resources;
@ -1130,7 +1131,7 @@ public class UniversalFileTransferUtility
{
return false;
}
else if (destinationFile != null && file.exists()) {
else if (destinationFile != null && file.exists()) {
destinationFile.setLastModified(file.lastModified());
if (destinationFile.length() != file.length()) {
@ -1587,7 +1588,13 @@ public class UniversalFileTransferUtility
if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS))
{
SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder);
((FileServiceSubSystem)targetFS).getFileService().setLastModified(newPathBuf.toString(), name, properties.getRemoteFileTimeStamp(), monitor);
try {
((FileServiceSubSystem)targetFS).getFileService().setLastModified(newPathBuf.toString(), name, properties.getRemoteFileTimeStamp(), monitor);
}
catch (SystemMessageException e){
// service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
}
}
}
@ -1825,16 +1832,22 @@ public class UniversalFileTransferUtility
if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS))
{
SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder);
long timestamp = properties.getRemoteFileTimeStamp();
// srcFileOrFolder may not be a file from the RemoteSystemTempFiles folder in which
// case there will be no stored property for the remote timestamp.
if (timestamp == 0)
timestamp = srcFileOrFolder.getLocalTimeStamp();
SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder);
long timestamp = properties.getRemoteFileTimeStamp();
// srcFileOrFolder may not be a file from the RemoteSystemTempFiles folder in which
// case there will be no stored property for the remote timestamp.
if (timestamp == 0)
timestamp = srcFileOrFolder.getLocalTimeStamp();
try {
targetFS.setLastModified(copiedFile, timestamp, monitor);
}
}
catch (SystemMessageException e){
// service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
}
}
return copiedFile;
}
@ -2067,7 +2080,13 @@ public class UniversalFileTransferUtility
if (source instanceof IFile)
{
SystemIFileProperties properties = new SystemIFileProperties(source);
target.getParentRemoteFileSubSystem().setLastModified(target, properties.getRemoteFileTimeStamp(), monitor);
try {
target.getParentRemoteFileSubSystem().setLastModified(target, properties.getRemoteFileTimeStamp(), monitor);
}
catch (SystemMessageException e){
// service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
}
}
else if (source instanceof IContainer)
{

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* David McKnight (IBM) - [192704] work around drag&drop issues from Project Explorer
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
* David McKnight (IBM) - [234924] [ftp][dnd][Refresh] Copy/Paste file from Package Explorer doesn't refresh folder
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
@ -23,6 +24,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
@ -48,6 +50,9 @@ import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.TransferData;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.part.EditorInputTransfer;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.PluginTransferData;
@ -180,6 +185,19 @@ extends ViewerDropAdapter
}
_sourceType = SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE;
}
else if (data instanceof EditorInputTransfer.EditorInputData[])
{
EditorInputTransfer.EditorInputData[] editorInput = (EditorInputTransfer.EditorInputData[])data;
for (int i = 0; i < editorInput.length; i++)
{
IPersistableElement inData = editorInput[i].input.getPersistable();
if (inData instanceof FileEditorInput){
IFile file = ((FileEditorInput)inData).getFile();
srcObjects.add(file);
}
}
_sourceType = SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE;
}
else if (data instanceof String[])
{
String[] resources = (String[]) data;