* @see java.lang.Runnable#run()
*/
public void run() {
IWorkbenchPartSite site = editor.getEditorPart().getSite();
final IWorkbenchWindow workbenchWindow = (site == null) ? null : site.getWorkbenchWindow();
final IWorkbenchSiteProgressService jobService = (IWorkbenchSiteProgressService) ((site == null) ? null : site.getAdapter(IWorkbenchSiteProgressService.class));
/*
* Try to use the progress service so the workbench can give more
* feedback to the user (although editors seem to make less use of
* the service than views -
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=86221 .
*/
if (workbenchWindow != null && jobService != null) {
/*
* Doc is ambiguous, but it must be run from the UI thread -
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=165180
*/
try {
jobService.runInUI(workbenchWindow, this, (ISchedulingRule) editor.getEditorPart().getEditorInput().getAdapter(IResource.class));
}
catch (InvocationTargetException e) {
Logger.logException(e);
}
catch (InterruptedException e) {