1 11 package org.eclipse.ui.internal.dialogs; 12 13 import java.util.List ; 14 15 import org.eclipse.jface.viewers.IStructuredContentProvider; 16 import org.eclipse.jface.viewers.Viewer; 17 18 21 public class ListContentProvider implements IStructuredContentProvider { 22 List contents; 23 24 public ListContentProvider() { 25 } 26 31 public Object [] getElements(Object input) { 32 if (contents != null && contents == input) { 33 return contents.toArray(); 34 } 35 return new Object [0]; 36 } 37 42 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 43 if (newInput instanceof List ) { 44 contents = (List ) newInput; 45 } 46 else { 47 contents = null; 48 } 49 } 50 55 public void dispose() { 56 } 57 } 58 | Popular Tags |