Bug 482354 - SVN checkout deadlocks Eclipse

FileDocumentProvider.refreshFile(IFile) is called from UI thread but in
worst case (if the IFile is out-of-sync with file system state) it
acquires workspace lock for refreshing the resource state.

If at same time any workspace job holding a lock on a parent project
will try to use IOConsoleOutputStream.write(String) to report lot of
data (> 160000 characters) to the console, the
IOConsolePartitioner.streamAppended() call will block forever waiting
for queue processed by the (locked) UI thread.

Proposed solution: FileDocumentProvider.refreshFile(IFile) should run
DocumentProviderOperation in providers runnable context to avoid such
deadlocks. In the case the resource tree is locked, a "User Operation is
Waiting" progress dialog will be shown, giving the user a chance to
resolve the deadlock situation by canceling one of the affected tasks.

To be consistent with existing API and to allow clients override the
supplied refresh rule, new API is introduced in FileDocumentProvider:
protected ISchedulingRule.getRefreshRule(Object element). Default
implementation in FileDocumentProvider uses
ResourceRuleFactory.refreshRule for given file.

Conflicts:
	org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
	org.eclipse.ui.editors.tests/pom.xml
	org.eclipse.ui.editors/META-INF/MANIFEST.MF
	org.eclipse.ui.editors/pom.xml

Change-Id: Id742d98403cc546fad4a21d25eb18ab7bef48776
8 files changed