1 11 package org.eclipse.pde.internal.ui.views.dependencies; 12 13 import org.eclipse.jface.viewers.ITreeContentProvider; 14 import org.eclipse.osgi.service.resolver.BundleDescription; 15 import org.eclipse.pde.core.plugin.IPluginBase; 16 import org.eclipse.pde.core.plugin.IPluginModelBase; 17 18 public class CallersTreeContentProvider extends CallersContentProvider 19 implements ITreeContentProvider { 20 21 24 public CallersTreeContentProvider(DependenciesView view) { 25 super(view); 26 } 27 28 public Object [] getChildren(Object parentElement) { 29 if (parentElement instanceof IPluginBase) { 30 parentElement = ((IPluginBase)parentElement).getModel(); 31 } 32 if (parentElement instanceof IPluginModelBase ) { 33 parentElement = ((IPluginModelBase)parentElement).getBundleDescription(); 34 } 35 if (parentElement instanceof BundleDescription) { 36 return findReferences((BundleDescription)parentElement).toArray(); 37 } 38 return new Object [0]; 39 } 40 41 45 public Object [] getElements(Object inputElement) { 46 if (inputElement instanceof IPluginModelBase) { 47 return new Object [] { ((IPluginModelBase) inputElement) 48 .getPluginBase() }; 49 } 50 return new Object [0]; 51 } 52 53 56 public Object getParent(Object element) { 57 return null; 58 } 59 60 63 public boolean hasChildren(Object element) { 64 return getChildren(element).length > 0; 65 } 66 67 } 68 | Popular Tags |