Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to get IWorkspace object from the path?
How to get IWorkspace object from the path? [message #1001379] Wed, 16 January 2013 10:42 Go to next message
Latha Shankara is currently offline Latha Shankara
Messages: 30
Registered: June 2012
Member
Hi,

I am new to plug-in development. I am developing a command line application, which takes workspace path as one of its arguments.

For further processing, I need to get IWorkspace object from the workspace path provided as an argument. How can I get the same?

ResourcesPlugin.getWorkspace() method gives the IWorkspace object of the Eclipse workspace I use. Aad also read that these methods cannot be used if the Eclipse workspace is closed as such.

Which other way can I get the IWorkspace object?

I apologise if my question seems stupid.

Thanks in advance,
Latha
Re: How to get IWorkspace object from the path? [message #1001413 is a reply to message #1001379] Wed, 16 January 2013 11:47 Go to previous message
Greg Pugh is currently offline Greg Pugh
Messages: 15
Registered: July 2009
Junior Member
On 16/01/2013 15:42, Latha Shankara wrote:
> Hi,
>
> I am new to plug-in development. I am developing a command line application, which takes workspace path as one of its arguments.
>
> For further processing, I need to get IWorkspace object from the workspace path provided as an argument. How can I get the same?
>
> ResourcesPlugin.getWorkspace() method gives the IWorkspace object of the Eclipse workspace I use. Aad also read that these methods cannot be used if
> the Eclipse workspace is closed as such.
>
> Which other way can I get the IWorkspace object?
>
> I apologise if my question seems stupid.
>
> Thanks in advance,
> Latha

You can use ResourcesPlugin.getWorkspace() provided you launch the command line app using org.eclipse.equinox.launcher_xxx.jar with your application
defined using the org.eclipse.core.runtime.applications extension point. Your class needs to implement org.eclipse.equinox.app.IApplication.

The workspace is specified by the "-data path" command parameter which is handled by the launcher jar.
Previous Topic:Tutorials on plugin development
Next Topic:How to get Resource from Handler?
Goto Forum:
  


Current Time: Wed Aug 20 22:26:57 EDT 2014

Powered by FUDForum. Page generated in 0.10345 seconds