1 11 12 package org.eclipse.jface.viewers; 13 14 import java.util.Collection ; 15 16 25 public class ArrayContentProvider implements IStructuredContentProvider { 26 27 31 public Object [] getElements(Object inputElement) { 32 if (inputElement instanceof Object []) { 33 return (Object []) inputElement; 34 } 35 if (inputElement instanceof Collection ) { 36 return ((Collection ) inputElement).toArray(); 37 } 38 return new Object [0]; 39 } 40 41 44 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 45 } 47 48 51 public void dispose() { 52 } 54 } 55 | Popular Tags |