|Converting IFile to IDocument [message #982652]
||Tue, 13 November 2012 04:54
| Kivanc Muslu
Registered: November 2010
Hi all, |
I was using the following method calls to convert an IFile to an IDocument:
IDocumentProvider provider = new TextFileDocumentProvider();
provider.connect(file); // file is of IFile
IDocument document = provider.getDocument(file);
However, this code runs in a headless Eclipse instance that I create (with -nosplash option) and it turns out that running any code that requires UI operations (especially access to the UI Thread) is not a good idea for headless applications. For once, on Mac, it turns out that the UI thread can only be initialized with the main thread, which causes a couple of problems.
So, I was wondering whether there is a way to convert an IFile object to an IDocument object without touching UI thread (and/or code)?
Thanks in advance, best regards,
[Updated on: Tue, 13 November 2012 04:56]
Report message to a moderator