Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to create a project in another Workspace programatically?
icon4.gif  How to create a project in another Workspace programatically? [message #653608] Thu, 10 February 2011 11:50 Go to next message
Kivanc Muslu is currently offline Kivanc MusluFriend
Messages: 153
Registered: November 2010
Senior Member
Hi all,

Using eclipse API, is it possible to create a project in another workspace (other than what is returned by ResourcesPlugin.getWorkspace)?

I have a plugin, and if possible I want to create (and later access) a project in a different workspace then the current workspace of the Eclipse running (as the plugin).

Thanks in advance, best regards,
Re: How to create a project in another Workspace programatically? [message #666140 is a reply to message #653608] Tue, 19 April 2011 10:04 Go to previous messageGo to next message
kleig  is currently offline kleig Friend
Messages: 1
Registered: April 2011
Junior Member
Hi,

I have the same problem as you, or very similar.
I want to make a plugin that creates a new workspace (other than one which is running the plugin; other than what is returned by ResourcesPlugin.getWorkspace like you said ), and in this new workspace, I would like to import some projects...
When the new workspace is ready, the plugin should open the new workspace with new projects imported (as if we switch workspace)


Have you made some progress with this?
Could you help me?

Can anyone help me?
Re: How to create a project in another Workspace programatically? [message #666258 is a reply to message #666140] Tue, 19 April 2011 16:08 Go to previous message
Kivanc Muslu is currently offline Kivanc MusluFriend
Messages: 153
Registered: November 2010
Senior Member
Hi Kleig,

Sorry, but I have no chance so far. It seems that at the moment Eclipse can handle one workspace during a plug-in's life cycle. To jump to another workspace, it seems that you have to close and re-open the eclipse (i..e, run all plug-ins from the beginning again).

Maybe your question is possible though. You just need to have a generic code that checks the location of the workspace at the beginning of the plug-in, if it matches your workspace, then start importing the projects you want. If not, then close Eclipse, change its workspace location and reopen it (I am assuming these are possible since Eclipse itself does it, not that I know a way for doing it Smile).

You might want to explore those parts a little, maybe create another thread such as 'how to close Eclipse and open it with a new workspace programmatically' or something like that, so that people can help you (I am not sure if this thread is being watched or not).

Hope you can solve your problem, if you do please let me know (it can give me some insight).

Thanks,
Previous Topic:[SOLVED] Project build path questions
Next Topic:[Java] issues creating a file
Goto Forum:
  


Current Time: Tue Apr 23 06:33:31 GMT 2024

Powered by FUDForum. Page generated in 0.03217 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top