Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [CNF] Link with editor / lazy tree & auto-expanding the tree
[CNF] Link with editor / lazy tree & auto-expanding the tree [message #550161] Thu, 29 July 2010 12:09 Go to next message
Christophe Fondacci is currently offline Christophe FondacciFriend
Messages: 95
Registered: July 2009
Location: Paris
Member
Hello,

I got a little problem with Common Navigator Framework in a RCP project for which I haven't found any solution, but I am sure there is :

* I got a CNF viewer with many different content providers
* I implemented the "Link with editor" features by providing my ILinkHelper implementation
* I also have a "Open type" feature which can open editors on elements selected by the user from a search dialog (just like eclipse java ide : open type / open resource).

The problem is that the CNF tree is "virtual" and it loads tree contents in a lazy way. Therefore the "link with editor" feature does not work on tree items which never got expanded because CNF does not yet know which element there will be in the child tree.

My LinkHelper provides the appropriate selection from an editor input but the CNF cannot retrieve the selection in the tree because it would be in child content which has not yet been provided.


The perfect behaviour for me would be that when the "Link with editor" feature is active, opening an element through the "Open type" automatically expand the tree hierarchy in the navigator to reveal and then select the corresponding item.

Is there any way to do this ? (note that I do not want to load all the content only for this feature...). I looked in the Eclipse sources but cannot figure out how it is done in the project explorer / open type action. I think there is some existing features for this because it works perfectly well in the Eclipse Java IDE.

Thank you very much,
Christophe
http://www.nextep-softwares.com

Re: [CNF] Link with editor / lazy tree & auto-expanding the tree [message #552289 is a reply to message #550161] Wed, 11 August 2010 15:18 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
Look at the ResourceLinkHelper class, it's the one that handles the Project Explorer.

Re: [CNF] Link with editor / lazy tree & auto-expanding the tree [message #553060 is a reply to message #552289] Mon, 16 August 2010 09:52 Go to previous messageGo to next message
Christophe Fondacci is currently offline Christophe FondacciFriend
Messages: 95
Registered: July 2009
Location: Paris
Member
Hello and thank you for your answer.

I checked the ResourceLinkHelper, but unfortunately it seems only to provide the appropriate ISelection to the CommonNavigator.

In my situation, I also succeed in providing the ISelection, the problem is more that the CommonNavigator does not yet "know" that this selection is in the tree since all parent nodes have not yet been expanded so the content has not been fetched from the content providers.

I tried adding a ICommonViewerMapper implementing the "handlesObject(Object)" method as I guessed that this method would be called by the viewer to know wether the object is in the tree but this method is never called.

I also tried to implement correctly the getParent() method from the content provider and to add the appropriate possibleParents and possibleChild in the extension definition but I did not succeed. I am not sure whether there are bugs in my code or wether there is some other things to do to make it work...

Could you point me to documentation or information regarding the steps to verify to ensure proper "link with editor" feature on lazily loaded elements ?

This would help me very much.
Thanks,
Christophe.
http://www.nextep-softwares.com
Re: [CNF] Link with editor / lazy tree & auto-expanding the tree [message #1864091 is a reply to message #553060] Fri, 15 March 2024 02:04 Go to previous messageGo to next message
Hubert Guerard is currently offline Hubert GuerardFriend
Messages: 5
Registered: August 2018
Junior Member
I know this is an old thread but were you able to find a solution?
Re: [CNF] Link with editor / lazy tree & auto-expanding the tree [message #1864100 is a reply to message #550161] Fri, 15 March 2024 19:37 Go to previous message
Hubert Guerard is currently offline Hubert GuerardFriend
Messages: 5
Registered: August 2018
Junior Member
I am posting the solution regarding "this problem". In fact, it is the responsibility of the content provider, via the getParent() method to find the parent of a given element. This is how the common viewer expand the node until the element is found.

[Updated on: Fri, 15 March 2024 19:38]

Report message to a moderator

Previous Topic:Run multiple instances of an RCP product/applications
Next Topic:RCP Integrated CDT
Goto Forum:
  


Current Time: Tue May 21 10:14:18 GMT 2024

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

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

Back to the top