// BUG 178598 - If the resource is shared, and it's possible to
// get the workbench Display, the UI thread is asked to execute the
// format of the file when it can
try {
ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
ITextFileBuffer buffer = null;
try {
if(manager != null) {
manager.connect(file.getFullPath(), LocationKind.IFILE, monitor);
buffer = manager.getTextFileBuffer(resource.getFullPath(), LocationKind.IFILE);
}
if(buffer != null && buffer.isShared()) {
Display display = getDisplay();
display.syncExec(new Runnable() {
public void run() {
format(monitor, file);
}