1 11 package org.eclipse.pde.internal.ui.view; 12 13 import java.util.HashSet ; 14 import java.util.Set ; 15 16 import org.eclipse.pde.core.plugin.IFragment; 17 import org.eclipse.pde.core.plugin.IPluginBase; 18 import org.eclipse.pde.core.plugin.IPluginImport; 19 import org.eclipse.pde.core.plugin.IPluginModelBase; 20 import org.eclipse.pde.internal.core.ModelEntry; 21 22 public class CallersContentProvider extends DependenciesViewPageContentProvider { 23 public CallersContentProvider(DependenciesView view) { 24 super(view); 25 } 26 27 31 protected Set findReferences(String id) { 32 ModelEntry[] entries = getPluginManager().getEntries(); 33 Set l = new HashSet (entries.length); 34 for (int i = 0; i < entries.length; i++) { 35 IPluginModelBase candidate = entries[i].getActiveModel(); 36 IPluginBase candidateBase = candidate.getPluginBase(false); 37 if (candidateBase == null) { 38 continue; 39 } 40 IPluginImport[] imports = candidateBase.getImports(); 42 for (int m = 0; m < imports.length; m++) { 43 String candidateId = imports[m].getId(); 44 if (id.equals(candidateId)) { 45 l.add(candidateBase); 46 } 47 } 48 if (candidateBase instanceof IFragment) { 50 String candidateId = ((IFragment) candidateBase).getPluginId(); 51 if (id.equals(candidateId)) { 52 l.add(candidateBase); 53 } 54 } 55 } 56 return l; 57 } 58 59 } 60 | Popular Tags |