1 11 package org.eclipse.jdt.internal.ui.javadocexport; 12 13 import org.eclipse.jface.viewers.ITreeContentProvider; 14 import org.eclipse.jface.viewers.Viewer; 15 16 import org.eclipse.jdt.core.ICompilationUnit; 17 import org.eclipse.jdt.core.IPackageFragment; 18 import org.eclipse.jdt.core.JavaModelException; 19 20 import org.eclipse.jdt.internal.ui.JavaPlugin; 21 22 public class JavadocMemberContentProvider implements ITreeContentProvider { 23 24 27 public Object [] getChildren(Object parentElement) { 28 return new Object [0]; 29 } 30 31 34 public Object getParent(Object element) { 35 if (element instanceof IPackageFragment) 38 return ((IPackageFragment) element).getParent(); 39 return null; 40 } 41 42 45 public boolean hasChildren(Object element) { 46 try { 47 if (element instanceof IPackageFragment) { 48 IPackageFragment iPackageFragment= (IPackageFragment) element; 49 return (iPackageFragment.getChildren().length > 0); 50 } 51 } catch (JavaModelException e) { 52 } 53 return false; 54 } 55 56 59 public Object [] getElements(Object inputElement) { 60 try { 61 if (inputElement instanceof IPackageFragment) { 62 ICompilationUnit[] cu= ((IPackageFragment) inputElement).getCompilationUnits(); 63 return cu; 64 } 65 } catch (JavaModelException e) { 66 JavaPlugin.log(e); 67 } 68 return new Object [0]; 69 } 70 71 74 public void dispose() { 75 } 76 77 80 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 81 } 82 83 } 84 | Popular Tags |