Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Re: How are IFile and IProjects added to PackageExplorer view ?
Re: How are IFile and IProjects added to PackageExplorer view ? [message #97426] Tue, 22 July 2003 11:07 Go to next message
Eclipse UserFriend
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
Re: How are IFile and IProjects added to PackageExplorer view ? [message #97688 is a reply to message #97426] Tue, 22 July 2003 18:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luis_benitez.nospam.us.ibm.com

Hi Matt,

Thanks for the advice. I get it now!!!! I do have one more question. If
IJavaElement extends IAdaptable, shouldn't JavaElement implement the
getAdapter() method.
I can't see anywhere where this method is implemented.

Does anybody know ?

Thanks,

-Luis

"Matthew Dickie" <md@decisionsoft.co.uk> wrote in message
news:bfjjvb$85m$1@eclipse.org...
> 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.
>
Re: How are IFile and IProjects added to PackageExplorer view ? [message #97717 is a reply to message #97688] Tue, 22 July 2003 18:40 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NOSPAM.us.ibm.com

JavaElement does implement it, via inheritance. Its supertype
PlatformObject implements it.

Rich
Previous Topic:CVS: cvsignore no longer available
Next Topic:Re: popmenu
Goto Forum:
  


Current Time: Mon Jul 14 13:27:45 EDT 2025

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

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

Back to the top