Re: How are IFile and IProjects added to PackageExplorer view ? [message #97426] |
Tue, 22 July 2003 11:07  |
Eclipse User |
|
|
|
Originally posted by: md.decisionsoft.co.uk
Hi Luis,
I was wondering the exact same thing, but now I've worked it out.
What you are missing is adapters. If you look at the plugin.xml file for
the Team UI plugin (org.eclipse.team.ui), where it extends the
extension point org.eclipse.ui.popupMenus:
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
id="org.eclipse.team.ui.ResourceContributions"
objectClass="org.eclipse.core.resources.IResource"
adaptable="true">
The adaptable="true" attribute means that the team context menu is
also automatically added for all object types which are adaptable
to IResouce. To see how the JDT does this look at the class
org.eclipse.jdt.internal.ui.JavaPlugin, and the methods
registerAdapters() and unregisterAdapters. In particular look at
JavaElementAdapterFactory.java in the same package, which has a
getResource method that is called when getAdapter is called with
parameter key equal to IResource.class.
Cheers
Matt
Luis Benitez wrote:
> Hello,
>
> I was looking at the PackageExplorerPart.java under
> org.eclipse.jdt.internal.ui.packageview to try and figure out how IFile's
> and IProject's are added. To my surprise, the view seems to contain only
> elements that extend JavaElement or are part of JavaModel.
>
> If that's the case, how are the Team actions added to the Package Explorer
> part since these objects are not IFile nor IProjects. Am I missing
> something essential here ?
>
> Thanks,
>
> -Luis
>
>
--
Matthew Dickie +44-1865-203192
DecisionSoft Limited http://www.decisionsoft.com
XML Development and Services
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.23781 seconds