Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Running 'NewLibraryPluginCreationOperation' in a headless application
Running 'NewLibraryPluginCreationOperation' in a headless application [message #988695] Sat, 01 December 2012 08:12 Go to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
Hi all,

I am trying to write a headless application (instance of IApplication) that would let me create new plug-in projects from the given jar archives from the command line. I have the following problem:

NewProjectCreationOperation.execute(..) (which is called through run(..)) executes the following:
		openFile((IFile) fModel.getUnderlyingResource());


As far as I can understand, this code touches the workbench at some point and whenever I run my IApplication from the command line, I get an IllegalStateException saying that the Workbench is not initialized yet.

So my questions:
1- Is there a way to run IApplications so that they wait for Workbench creation (e.g., a mode where the UI is also loaded)? This can also be another extension point that I don't know yet, if that is the case, please let me know.
2- since openFile(..) was the last code to execute in execute(..), I tried catching this exception in my IApplication. As a result, the application works fine and creates the new plug-in project, however Eclipse incremental builder starts having problems with the projects that depend on this newly created project. The error view suggests me to clean and rebuild the new project, however when I try that it does not work (I cannot get rid of that error). The only way I can fix the problem is to close and reopen the project. Can someone provide an explanation (or related code, documentation) for this?

Thank you,
Re: Running 'NewLibraryPluginCreationOperation' in a headless application [message #989612 is a reply to message #988695] Thu, 06 December 2012 17:59 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 999
Registered: July 2009
Senior Member
Part 1 can best be answered by some expert of org.eclipse.core.resources (try asking in the Eclipse Platform forum). You may want to give more details on how that code touches the *workbench*, I'd expect that an initialized *workspace* should suffice.

Regarding part 2 I don't exactly understand the connection between your IApplication and the Eclipse incremental builder. Are you running your IApplication while Eclipse is running? How is eclipse supposed to pick up the newly created project? Why not invoke this operation as a command inside the IDE?

cheers,
Stephan
Previous Topic:String.indexof()
Next Topic:Eclipse with Subclipse behavior against Maven file structure is strange
Goto Forum:
  


Current Time: Sat Aug 30 14:34:18 EDT 2014

Powered by FUDForum. Page generated in 0.02681 seconds