Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Converting IFile to IDocument
Converting IFile to IDocument [message #982652] Tue, 13 November 2012 04:54 Go to previous message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 128
Registered: November 2010
Senior Member
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);
provider.disconnect(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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Adding content assist to non-javadoc in java editor.
Next Topic:eclipse.launcher returns NULL when running JUnit plug-in tests
Goto Forum:
  


Current Time: Fri May 24 04:52:03 EDT 2013

Powered by FUDForum. Page generated in 0.01965 seconds