| Does anyone really understand 'adaptable'? [message #215507] |
Wed, 24 March 2004 18:54  |
Eclipse User |
|
|
|
Does anyone really understand the attribute "adaptable" in the element
"objectContribution" of the extension point "org.eclipse.ui.popupMenus"?
E.g.:
I defined an extension for this extension point with
objectClass="org.eclipse.core.resources.IFile" and adaptable="true".
The new menu item is also shown in the context menu of java files in the
package explorer (org.eclipse.jdt.internal.core.CompilationUnit).
But this is what I don't understand.
org.eclipse.jdt.internal.core.CompilationUnit is neither an IFile, nor
is an ancestor of CompilationUnit an IFile, nor is CompilationUnit
adapting IFile.
So what does adaptable="true" really mean?
- Has the selected object to adapt the interface named in the attribute
"objectClass"?
- Or has the selected object to adapt IResource? But if this is true,
what is meaning of "objectClass" when adaptable="true"?
Thanks,
Oliver
|
|
|
|
|
|
| Re: Does anyone really understand 'adaptable'? [message #224089 is a reply to message #224081] |
Wed, 07 April 2004 17:53  |
Eclipse User |
|
|
|
Originally posted by: xxx.ca.ibm.com
now that I think about it, I have to clarify.
I believe that your model has to be the IResource model for the "adapt"
stuff to work.
But still, if you define your own model, use it in objectClass and
contributions will appear there, regardless of adaptable.
I might have just confused you! sorry.
anyways, just my two cents..
Mazen
"Mazen Faraj" <xxx@ca.ibm.com> wrote in message
news:c51s4g$5sd$1@eclipse.org...
> Oliver,
> using objectClass="model class"
> is telling your object contribution to appear in every view were instances
> of "model class" appear.
> Every view has a model, aka object/class types. IResource is one model. If
> you create your own model class, you can use:
>
> objectClass="xxx.yyy.foo" and adaptable="true".
> That means that this object contribution will only appear if instances of
> xxx.yyy.foo class appear somewhere.
> AND
> since adaptable=true, this means that means that any model that know how
to
> adapt to IResource will get your contribution, even if the model is not
> yours (ie: xxx.yyy.foo).
>
> - Has the selected object to adapt the interface named in the attribute
> "objectClass"?
> No. adapt to IResource model
> Or has the selected object to adapt IResource? But if this is true, what
is
> meaning of "objectClass" when adaptable="true"?
> yes. If the selection is your model (ie:objectClass ) then that
contribution
> will appear on your objects (even if your model does not adapt to
> IResource).
>
> Hope this somewhat helps...
> Mazen Faraj
>
>
>
> "Ed Burnette" <ed.burnette@REMOVE.THIS.sas.com> wrote in message
> news:c4l5o9$q80$1@eclipse.org...
> > adaptable=true currently means adaptable to IResource. I consider it a
bug
> > but I think it's left that way for backwards compatability.
> >
> > --
> > Ed Burnette, co-author, Eclipse in Action
> > www.eclipsepowered.org
> >
> > "Oliver Widder" <oliver.widder@sdm.de> wrote in message
> > news:c3t6r0$646$1@eclipse.org...
> > > Does anyone really understand the attribute "adaptable" in the element
> > > "objectContribution" of the extension point
"org.eclipse.ui.popupMenus"?
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03665 seconds