1
/*******************************************************************************
2
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Markus Schorn - initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.internal.ui.viewsupport;
14
import org.eclipse.jface.viewers.TreeViewer;
15
import org.eclipse.swt.widgets.Composite;
17
public class ExtendedTreeViewer extends TreeViewer {
19
private boolean fPreservingSelection= false;
21
public ExtendedTreeViewer(Composite parent) {
25
public ExtendedTreeViewer(Composite parent, int style) {
29
public void refresh(final Object[] elements) {
30
preservingSelection(new Runnable() {
32
for (int i = 0; i < elements.length; i++) {
40
protected void preservingSelection(Runnable updateCode) {
41
if (fPreservingSelection) {
45
fPreservingSelection= true;
47
super.preservingSelection(updateCode);
50
fPreservingSelection= false;