use of org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter in project xtext-eclipse by eclipse.
the class RefactoringWizardOpenOperation_NonForking method checkInitialConditions.
/**
* CHANGED to protected
* CHANGED do not fork as we are keeping the resource lock.
*/
protected RefactoringStatus checkInitialConditions(Refactoring refactoring, Shell parent, String title, IRunnableContext context) throws InterruptedException {
try {
CheckConditionsOperation cco = new CheckConditionsOperation(refactoring, CheckConditionsOperation.INITIAL_CONDITONS);
WorkbenchRunnableAdapter workbenchRunnableAdapter = new WorkbenchRunnableAdapter(cco, ResourcesPlugin.getWorkspace().getRoot());
/* CHANGE: don't fork (or use busyCursorWhile) as this will cause a deadlock */
if (context == null) {
PlatformUI.getWorkbench().getProgressService().run(false, true, workbenchRunnableAdapter);
} else if (context instanceof IProgressService) {
((IProgressService) context).run(false, true, workbenchRunnableAdapter);
} else {
context.run(false, true, workbenchRunnableAdapter);
}
return cco.getStatus();
} catch (InvocationTargetException e) {
ExceptionHandler.handle(e, parent, title, RefactoringUIMessages.RefactoringUI_open_unexpected_exception);
return RefactoringStatus.createFatalErrorStatus(RefactoringUIMessages.RefactoringUI_open_unexpected_exception);
}
}
Aggregations