mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-23 08:13:50 +02:00
double-click file download using background job
This commit is contained in:
parent
5c5121a9ed
commit
cb9c15e29a
4 changed files with 23 additions and 3 deletions
|
@ -3,10 +3,12 @@
|
||||||
*/
|
*/
|
||||||
package org.eclipse.rse.files.ui.view;
|
package org.eclipse.rse.files.ui.view;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
|
import org.eclipse.rse.files.ui.resources.SystemUniversalTempFileListener;
|
||||||
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
|
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
|
||||||
|
@ -47,7 +49,11 @@ public class DownloadJob extends Job
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_editable.download(monitor);
|
IFile localFile = _editable.getLocalResource();
|
||||||
|
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
|
||||||
|
listener.addIgnoreFile(localFile);
|
||||||
|
_editable.download(monitor);
|
||||||
|
listener.removeIgnoreFile(localFile);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,6 +131,7 @@ import org.eclipse.ui.ISharedImages;
|
||||||
import org.eclipse.ui.IWorkbench;
|
import org.eclipse.ui.IWorkbench;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
import org.eclipse.ui.progress.IElementCollector;
|
import org.eclipse.ui.progress.IElementCollector;
|
||||||
|
import org.eclipse.ui.progress.UIJob;
|
||||||
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
||||||
import org.eclipse.ui.views.properties.PropertyDescriptor;
|
import org.eclipse.ui.views.properties.PropertyDescriptor;
|
||||||
|
|
||||||
|
@ -2735,7 +2736,8 @@ public class SystemViewRemoteFileAdapter
|
||||||
{
|
{
|
||||||
if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.OPEN_IN_SAME_PERSPECTIVE)
|
if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.OPEN_IN_SAME_PERSPECTIVE)
|
||||||
{
|
{
|
||||||
editable.open(getShell());
|
DownloadJob oJob = new DownloadJob(editable);
|
||||||
|
oJob.schedule();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2746,6 +2748,8 @@ public class SystemViewRemoteFileAdapter
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (remoteFile.isDirectory())
|
else if (remoteFile.isDirectory())
|
||||||
{
|
{
|
||||||
|
@ -2761,7 +2765,7 @@ public class SystemViewRemoteFileAdapter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canEdit(Object element)
|
public boolean canEdit(Object element)
|
||||||
{
|
{
|
||||||
IRemoteFile remoteFile = (IRemoteFile) element;
|
IRemoteFile remoteFile = (IRemoteFile) element;
|
||||||
|
|
|
@ -107,6 +107,15 @@ public interface ISystemEditableRemoteObject
|
||||||
*/
|
*/
|
||||||
public void open(Shell shell, boolean readOnly);
|
public void open(Shell shell, boolean readOnly);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open in editor
|
||||||
|
*/
|
||||||
|
public void open(IProgressMonitor monitor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open in editor
|
||||||
|
*/
|
||||||
|
public void open(IProgressMonitor monitor, boolean readOnly);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set local resource properties
|
* Set local resource properties
|
||||||
|
|
|
@ -288,6 +288,7 @@ public class SystemViewDataDragAdapter extends DragSourceAdapter
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
Shell shell = event.display.getActiveShell();
|
Shell shell = event.display.getActiveShell();
|
||||||
if (editable.download(shell))
|
if (editable.download(shell))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue