Getting workspace from within a program [message #142341] |
Thu, 09 March 2006 00:33 |
Eclipse User |
|
|
|
Originally posted by: chandrac.kestral.com.au
Folks,
I am new to Eclipse and am trying to get the location of the current
workspace and the root workspace from within a program.
The Eclipse FAQ book (p 291, FAQ 286) suggests:
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
I have tried to run this as a code fragment from within Eclipse with
these two imports:
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
but have not been successful.
I tried running it as a JavascrapBook page (.jpage file with the
requisite imports) but it said that the Workspace was closed.
All I want is to see that the above code does return what I would expect
it to, so that I can use it to set some environment variables elsewhere.
What should I do to run it standalone?
Thanks for your help.
Chandra
[Cross-posted on the eclipse.platform newsgroup as well.]
|
|
|
Powered by
FUDForum. Page generated in 0.08232 seconds