Skip to main content



      Home
Home » Newcomers » Newcomers » How to locate file in workspace
How to locate file in workspace [message #105126] Tue, 27 September 2005 00:25 Go to next message
Eclipse UserFriend
I am trying to build a special launcher extension. I want to be able to
determine the name and location in the workspace of the file that is
currently "selected" in the Package Explorer window. What are the APIs that
I need to know about?

Thanks,
-- Mike
Re: How to locate file in workspace [message #106157 is a reply to message #105126] Thu, 29 September 2005 14:07 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

The API you're looking for is ISelectionService. This API allows you to
query and listen to the selection in a given workbench page
(IWorkbenchPage implements this interface). Also,
IWorkbenchPage.getSelectionService() will track the selection in a
window. Once you have the selection, you will find that the selection
contains IJavaElement objects rather than IResource. By calling
getAdapter(IResource.class), you can adapt the selected object to
IResource (if applicable).
--

Mike Greenawalt wrote:
> I am trying to build a special launcher extension. I want to be able to
> determine the name and location in the workspace of the file that is
> currently "selected" in the Package Explorer window. What are the APIs that
> I need to know about?
>
> Thanks,
> -- Mike
>
>
Previous Topic:handling inter project dependencies in ant
Next Topic:Jcop
Goto Forum:
  


Current Time: Fri May 09 08:34:30 EDT 2025

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

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

Back to the top