Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » PageBook and TreeViewer
PageBook and TreeViewer [message #305021] Wed, 21 June 2006 11:28 Go to next message
Eclipse User
Originally posted by: automatic.javalobby.org

Hello!I’m working on a RCP application and in one of my views, I have to display informations in a TreeViewer depending on which editor is activated.So I thought about using a PageBook.But I have a problem: it seems that I have some display issues with the PageBook: each time I activate a new editor, I create a new TreeViewer corresponding to it and I try to display it:
	_pageBook.showPage(_treeViewer.getControl());
For the first tree viewer, it works well, but when I try to display another one, my PageBook displays nothing, or the same TreeViewer has before but with no response to any mouse click…And when I come back to the first editor, the tree viewer corresponding to it is still well displayed…I don’t understand what is happening…So, basically, it seems to work but only with the first displayed TreeViewer!!Could somebody please help me?Thanks by advance!C.B.
Re: PageBook and TreeViewer [message #305121 is a reply to message #305021] Fri, 23 June 2006 04:57 Go to previous messageGo to next message
Eclipse User
Originally posted by: automatic.javalobby.org

Well, I didn't succed in using the Eclipse API PageBook... :-/
So I did it another way: I use only one TreeViewer and I reload it with the current data when the editor is changed.
I store the expanded elements in a HashMap<String,Object[]> where teh keys are the name of the current project (one tree structure per project) and the values are the expanded elements, and I save everything in a memento when I quit the view...
It seems to be working!
Re: PageBook and TreeViewer [message #305123 is a reply to message #305021] Fri, 23 June 2006 04:58 Go to previous messageGo to next message
Eclipse User
Originally posted by: automatic.javalobby.org

Well, I didn't succeed in using the Eclipse API PageBook... :-/
So I did it another way: I use only one TreeViewer and I reload it with the current data when the editor is changed.
I store the expanded elements in a HashMap<String,Object[]> where teh keys are the name of the current project (one tree structure per project) and the values are the expanded elements, and I save everything in a memento when I quit the view...
It seems to be working!
Re: PageBook and TreeViewer [message #305188 is a reply to message #305021] Mon, 26 June 2006 03:15 Go to previous messageGo to next message
Alain Marc Pannetier is currently offline Alain Marc Pannetier
Messages: 26
Registered: July 2009
Junior Member
I'm not sure why you would have to do showPage yourself.

If your TreeViewer is the main part of your view, then you might be better off extending PageBookView.

PageBookView takes care of remembering what page of you pagebook goes with what part and calls your various pages depending on what IWorkbenchPart you're interested in.

In addition, if you are to listen to changes or selection changes in the IDocument being processed by the (workbench)-page editors, it's also probably a sounder foundation.

Regards,

Alain Pannetier
Re: PageBook and TreeViewer [message #305194 is a reply to message #305188] Mon, 26 June 2006 04:52 Go to previous message
Eclipse User
Originally posted by: automatic.javalobby.org

I thought about that, but the problem is that every view (including the one I'm currently interested in) in the applicatiion extend an amount of abstract classes and I would have had to break a little bit the architecture which is not mine, create top interfaces, duplicate a lot of code, and so on...Too bad the Java does not support multiple inheritance for those type of issues :-/...Anyway, the solution I found seems to be working ;-)!
Previous Topic:Getting the menu items programmatically
Next Topic:CheckboxTableViewer - disabling checkboxes
Goto Forum:
  


Current Time: Tue Jul 22 09:27:48 EDT 2014

Powered by FUDForum. Page generated in 0.02567 seconds