1 11 package org.eclipse.pde.internal.ui.elements; 12 13 import org.eclipse.jface.viewers.ITreeContentProvider; 14 import org.eclipse.jface.viewers.Viewer; 15 16 public class TreeContentProvider extends ListContentProvider implements ITreeContentProvider { 17 18 public TreeContentProvider() { 19 super(); 20 } 21 public void dispose() {} 22 public Object [] getChildren(Object element) { 23 if (element instanceof IPDEElement) { 24 return ((IPDEElement)element).getChildren(); 25 } 26 return null; 27 } 28 public Object [] getElements(Object element) { 29 if (element instanceof IPDEElement) { 30 return ((IPDEElement)element).getChildren(); 31 } 32 return null; 33 } 34 public Object getParent(Object element) { 35 if (element instanceof IPDEElement) { 36 return ((IPDEElement)element).getParent(); 37 } 38 return null; 39 } 40 public boolean hasChildren(java.lang.Object element) { 41 if (element instanceof IPDEElement) { 42 Object [] children = ((IPDEElement)element).getChildren(); 43 return children != null && children.length > 0; 44 } 45 return false; 46 } 47 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 48 } 49 public boolean isDeleted(Object element) { 50 return false; 51 } 52 } 53 | Popular Tags |