Bug 324078 [IDE] Cannot create a virtual TreeViewer in ContentOutlinePage
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; }
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutlinePage.java
/* (non-Javadoc)
     * Method declared on ISelectionProvider.
     */
    public void removeSelectionChangedListener(
            ISelectionChangedListener listener) {
        selectionChangedListeners.remove(listener);
    }
    /* (non-Javadoc)
     * Method declared on ISelectionChangeListener.
     * Gives notification that the tree selection has changed.
     */
    public void selectionChanged(SelectionChangedEvent event) {
        fireSelectionChanged(event.getSelection());
    }
    /**
     * Sets focus to a part in the page.
     */
    public void setFocus() {
        treeViewer.getControl().setFocus();
    }
    /* (non-Javadoc)
     * Method declared on ISelectionProvider.
     */
    public void setSelection(ISelection selection) {
        if (treeViewer != null) {
			treeViewer.setSelection(selection);
		}
    }
}