1 /*******************************************************************************
2 * Copyright (c) 2000, 2005 IBM Corporation 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 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.viewsupport;
13 import java.util.List;
15 import org.eclipse.jface.viewers.IStructuredContentProvider;
16 import org.eclipse.jface.viewers.Viewer;
19 * A specialized content provider to show a list of editor parts.
21 public class ListContentProvider implements IStructuredContentProvider {
24 public ListContentProvider() {
27 public Object[] getElements(Object input) {
28 if (fContents != null && fContents == input)
29 return fContents.toArray();
33 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
34 if (newInput instanceof List)
35 fContents = (List) newInput;
38 // we use a fixed set.
41 public void dispose() {
44 // public boolean isDeleted(Object o) {
45 // return fContents != null && !fContents.contains(o);