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

[181006] schedule job to do asynch exec rather than directly do asynch exec

This commit is contained in:
David McKnight 2007-04-05 00:33:21 +00:00
parent 1d9c8e7d4b
commit 9cb7bd0227

View file

@ -22,6 +22,9 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
@ -73,6 +76,7 @@ import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.Workbench;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
@ -575,6 +579,22 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter
return result;
}
public class DelayedGotoLineJob extends Job
{
private DelayedGotoLine _gotoLine;
public DelayedGotoLineJob(DelayedGotoLine gotoLine)
{
super("Goto Line");
_gotoLine = gotoLine;
}
public IStatus run(IProgressMonitor monitor)
{
Workbench.getInstance().getDisplay().asyncExec(_gotoLine);
return Status.OK_STATUS;
}
}
public class DelayedGotoLine implements Runnable
{
private IRemoteFile _file;
@ -598,7 +618,9 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter
}
else
{
Display.getDefault().asyncExec(this);
DelayedGotoLineJob job = new DelayedGotoLineJob(this);
job.schedule();
//Display.getDefault().asyncExec(this);
}
}