How to get folder of current project [message #176175] |
Wed, 01 September 2004 02:42  |
Eclipse User |
|
|
|
Originally posted by: baiyanbin.163.com
Hi,
I am writing a plug-in that needs to know the folder of current project
in run method. How to get it by some simple calls?
Thanks,
Jack
|
|
|
Re: How to get folder of current project [message #176229 is a reply to message #176175] |
Wed, 01 September 2004 10:24  |
Eclipse User |
|
|
|
Originally posted by: richkulp.NO.SPAM.us.ibm.com
There technically isn't a definition of current project. There is a
current selection for a workbench page. Since you can have more than one
workbench page you can also have more than one selection.
If you have a View or an Editor or Workbench page that you are
interested in (for example your run method was kicked off from a view or
an editor, so it should have access to it), then you can get the current
selection for the page that the view/editor is in. But what is selected
may not be able to give you a project. If it is an IResource or is
adaptable to an IResource, then selection can give you a project.
However, there could be more than one selected IResource and they can
come from different projects, so which project is then the current project?
Maybe a little more info like who kicked off your runnable and what your
definition is of the current project (i.e. the selection in what
viewer). That could point to how to answer question.
--
Thanks, Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03353 seconds