Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Common Navigator Framework: how to get benefit from standard Navigator menus?
Common Navigator Framework: how to get benefit from standard Navigator menus? [message #329291] Wed, 18 June 2008 14:20 Go to next message
Eclipse UserFriend
Originally posted by: yves.monier.temis.com

Hi,

I'm currently digging into the CNF to replace a specific view and merge
it into a CommonNavigator.
I started my investigations from Michael Elder's invaluable articles.
My simple model can be represented as a simple tree:
Project
App. specific collection of items
Item 1
...
Item N


When required by the framework, my content provider's getChildren tells
that:

- Project has 1 child (the application collection of items). As an
IProject, it get benefits by default of standard Eclipse menus for
projects. Exactly what I want...

- The collection has N children. The collection object/class has no
relationship at all with Eclipse classes (IFile or whatever), therefore
Eclipse provides by default no popup menus for it. Ok, I can live with
that for the moment.

- As for their parent collection, items 1..N are also instances of a
class which isn't an Eclipse one, thus resulting in no specific popup
menu by default. Still, this class holds a private IResource member
(actually, an IFile), which my item's getAdapter method returns when
requested (I know it is called, for example when I double-click on the
item), and I would like Eclipse to provide me with the same popup menu
that it would display for this resource in the standard navigator.
Seems having the getAdapter returning the IResource is not enough to
achieve this...
In that case, what's missing?
One or more extensions?
I read something about IContributorResourceAdapter when I saw that my
getAdapter was sometimes called with a IContributorResourceAdapter
adapter parameter. It seems that implementing it might be (part of) the
solution to my problem, but I don't exactly see how to use it. I tried,
my getAdapterResource is called, I return my private IResource member,
but the popup menu still doesn't contains the expected items...

Thanks in advance for any hint,

Yves
Re: Common Navigator Framework: how to get benefit from standard Navigator menus? [message #329480 is a reply to message #329291] Wed, 25 June 2008 14:15 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
(sorry for my delay in getting to this, see comments below, please reply
to the newsgroup and not me personally)

Yves Monier wrote:
> Hi,
>
> I'm currently digging into the CNF to replace a specific view and merge
> it into a CommonNavigator.
> I started my investigations from Michael Elder's invaluable articles.
> My simple model can be represented as a simple tree:
> Project
> App. specific collection of items
> Item 1
> ...
> Item N
>
>
> When required by the framework, my content provider's getChildren tells
> that:
>
> - Project has 1 child (the application collection of items). As an
> IProject, it get benefits by default of standard Eclipse menus for
> projects. Exactly what I want...
>
> - The collection has N children. The collection object/class has no
> relationship at all with Eclipse classes (IFile or whatever), therefore
> Eclipse provides by default no popup menus for it. Ok, I can live with
> that for the moment.
>
> - As for their parent collection, items 1..N are also instances of a
> class which isn't an Eclipse one, thus resulting in no specific popup
> menu by default. Still, this class holds a private IResource member
> (actually, an IFile), which my item's getAdapter method returns when
> requested (I know it is called, for example when I double-click on the
> item), and I would like Eclipse to provide me with the same popup menu
> that it would display for this resource in the standard navigator.
> Seems having the getAdapter returning the IResource is not enough to
> achieve this...
I'm not sure what you mean by "parent collection" here.
> In that case, what's missing?
> One or more extensions?
Yes, you should include references to the extensions in
org.eclipse.ui.navigator.resources. See the example in this section for
how to do this:
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/cnf.htm

> I read something about IContributorResourceAdapter when I saw that my
> getAdapter was sometimes called with a IContributorResourceAdapter
> adapter parameter. It seems that implementing it might be (part of) the
> solution to my problem, but I don't exactly see how to use it. I tried,
> my getAdapterResource is called, I return my private IResource member,
> but the popup menu still doesn't contains the expected items...
>
I don't think implementing this will help you.

> Thanks in advance for any hint,
>
> Yves


Re: Common Navigator Framework: how to get benefit from standard Navigator menus? [message #330230 is a reply to message #329480] Tue, 22 July 2008 07:21 Go to previous message
Eclipse UserFriend
Originally posted by: yves.monier.temis.com

Hi,
I finally understood that IContributorResourceAdapter would not help me.
Now I use actionProvider and dragAssistant extensions, which work like a
charm.
Thanks for the highlights!

Yves

Francis Upton (News) a écrit :
> (sorry for my delay in getting to this, see comments below, please reply
> to the newsgroup and not me personally)
>
> Yves Monier wrote:
>> Hi,
>>
>> I'm currently digging into the CNF to replace a specific view and
>> merge it into a CommonNavigator.
>> I started my investigations from Michael Elder's invaluable articles.
>> My simple model can be represented as a simple tree:
>> Project
>> App. specific collection of items
>> Item 1
>> ...
>> Item N
>>
>>
>> When required by the framework, my content provider's getChildren
>> tells that:
>>
>> - Project has 1 child (the application collection of items). As an
>> IProject, it get benefits by default of standard Eclipse menus for
>> projects. Exactly what I want...
>>
>> - The collection has N children. The collection object/class has no
>> relationship at all with Eclipse classes (IFile or whatever),
>> therefore Eclipse provides by default no popup menus for it. Ok, I can
>> live with that for the moment.
>>
>> - As for their parent collection, items 1..N are also instances of a
>> class which isn't an Eclipse one, thus resulting in no specific popup
>> menu by default. Still, this class holds a private IResource member
>> (actually, an IFile), which my item's getAdapter method returns when
>> requested (I know it is called, for example when I double-click on the
>> item), and I would like Eclipse to provide me with the same popup menu
>> that it would display for this resource in the standard navigator.
>> Seems having the getAdapter returning the IResource is not enough to
>> achieve this...
> I'm not sure what you mean by "parent collection" here.
>> In that case, what's missing?
>> One or more extensions?
> Yes, you should include references to the extensions in
> org.eclipse.ui.navigator.resources. See the example in this section for
> how to do this:
> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/cnf.htm
>
>
>> I read something about IContributorResourceAdapter when I saw that my
>> getAdapter was sometimes called with a IContributorResourceAdapter
>> adapter parameter. It seems that implementing it might be (part of)
>> the solution to my problem, but I don't exactly see how to use it. I
>> tried, my getAdapterResource is called, I return my private IResource
>> member, but the popup menu still doesn't contains the expected items...
>>
> I don't think implementing this will help you.
>
>> Thanks in advance for any hint,
>>
>> Yves
Previous Topic:Refresh workspace on switching perspective
Next Topic:not to close parent dialog on cancel of child wizard
Goto Forum:
  


Current Time: Wed Jul 03 10:27:03 GMT 2024

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

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

Back to the top