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
/*******************************************************************************
 * Copyright (c) 2000, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.views.contentoutline;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;