1 11 12 package org.eclipse.jface.viewers; 13 14 28 public class TreeNodeContentProvider implements ITreeContentProvider { 29 34 public void dispose() { 35 } 37 38 43 public Object [] getChildren(final Object parentElement) { 44 final TreeNode node = (TreeNode) parentElement; 45 return node.getChildren(); 46 } 47 48 53 public Object [] getElements(final Object inputElement) { 54 if (inputElement instanceof TreeNode[]) { 55 return (TreeNode[]) inputElement; 56 } 57 return new Object [0]; 58 } 59 60 65 public Object getParent(final Object element) { 66 final TreeNode node = (TreeNode) element; 67 return node.getParent(); 68 } 69 70 75 public boolean hasChildren(final Object element) { 76 final TreeNode node = (TreeNode) element; 77 return node.hasChildren(); 78 } 79 80 86 public void inputChanged(final Viewer viewer, final Object oldInput, 87 final Object newInput) { 88 } 90 } 91 | Popular Tags |