How to get project information in a plugin! [message #166710] |
Sat, 06 December 2003 00:42  |
Eclipse User |
|
|
|
Originally posted by: duan-yonghong.sjtu.edu.cn
Hi,everyone:
Recently, I am busying develope a eclipse plugin. I am trying to realize
a function as follow: When you click a project name in Package explore, I
should get the information about which project user has clicked. I am
wondering how
to get the IProject object. What should I do?
Thank you!
Duanyh
SJTU
|
|
|
|
|
Re: How to get project information in a plugin! [message #167025 is a reply to message #166737] |
Sun, 07 December 2003 22:32  |
Eclipse User |
|
|
|
Originally posted by: duan-yonghong.sjtu.edu.cn
Hi, Chiristian Koppen,
After I went through org.eclipse.ui(Eclipse Platform API Specification)
, I
noticed that I should get an ISelectionService object to regist
ISelectionListener
objects. And I find out that ISelectionListener can be gotten by coding as
follow:
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow workbenchWindow =
workbench.getActiveWorkbenchWindow();
ISelectionService selectionServiece =
workbenchWindow.getSelectionService() ;
But I don't know how to associate the workbenchWindow with package
explorer view.
How can I know the current active window is package explorer ? And how can
I get
the package explorer view's IWorkbenchWindow object? Is this necessary?
Thank you!
Duanyh
SJTU
"Christian Koppen" <koppen@fmi.uni-passau.de>
??????:bqs6tg$eil$1@eclipse.org...
> Hi Duanyh,
>
> 1) register an ISelectionListener to catch the clicks
> 2) check the type of the clicked object
> (for example: IResource or IJavaElement)
> 3) call appropriate method on the object
> (for example: IResource.getProject()
> or
> IJavaElement.getJavaProject().getProject())
>
>
>
> duanyh schrieb:
>
> > Hi,everyone:
> > Recently, I am busying develope a eclipse plugin. I am trying to
realize
> > a function as follow: When you click a project name in Package explore,
I
> > should get the information about which project user has clicked. I am
> > wondering how
> > to get the IProject object. What should I do?
> > Thank you!
> >
> > Duanyh
> > SJTU
> >
> >
> >
>
|
|
|
Powered by
FUDForum. Page generated in 0.05267 seconds