Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324078 - [IDE] Cannot create a virtual TreeViewer in ContentOutlinePage
Summary: [IDE] Cannot create a virtual TreeViewer in ContentOutlinePage
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Paul Webster CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 07:50 EDT by Jan Koehnlein CLA
Modified: 2011-01-25 09:14 EST (History)
2 users (show)

See Also:


Attachments
add getTreeStyle() to page (1.82 KB, patch)
2011-01-06 13:50 EST, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Koehnlein CLA 2010-08-31 07:50:46 EDT
org.eclipse.ui.views.contentoutline.ContentOutlinePage has a private field TreeViewer treeViewer, that is initialized in the createControl method. If you want to use a virtual tree viewer, you cannot do that by subclassing as it requires an additonal flag in the constructor call. As a consequence, you have to double all the code in your implementation.

Possible solutions 
- provide a protected setTreeViewer() method
- extract the initialization flags into a protected method
  protected int getFlags() { return SWT.MULTI | SWT.H_SCROLL
                | SWT.V_SCROLL; }
Comment 1 Paul Webster CLA 2011-01-06 13:50:08 EST
Created attachment 186208 [details]
add getTreeStyle() to page

Could override and return different styles as necessary.

Jan, could you please test and see that making it a virtual tree doesn't mean any other changes?

PW
Comment 2 Jan Koehnlein CLA 2011-01-07 03:49:50 EST
Thanks for the patch. It looks fine.

I don't see any more obstacles making an outline tree virtual apart from the general performance issue in #266189.
Comment 3 Remy Suen CLA 2011-01-07 08:42:44 EST
(In reply to comment #1)
> Created attachment 186208 [details]
> add getTreeStyle() to page

This patch makes sense to me, +1. Please update the copyright header to 2011 while you're at it and maybe put a note in the class-level javadoc about the new method for configuring the tree viewer's construction.
Comment 4 Paul Webster CLA 2011-01-07 13:39:18 EST
Updated the javadoc and released to HEAD
PW
Comment 5 Paul Webster CLA 2011-01-25 09:14:02 EST
new API in I20110124-1800
PW