KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > views > dependencies > CallersContentProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.views.dependencies;
12
13 import java.util.Arrays JavaDoc;
14 import java.util.Collection JavaDoc;
15 import java.util.Collections JavaDoc;
16
17 import org.eclipse.osgi.service.resolver.BundleDescription;
18
19 public class CallersContentProvider extends DependenciesViewPageContentProvider {
20     public CallersContentProvider(DependenciesView view) {
21         super(view);
22     }
23     
24     protected Collection JavaDoc findReferences(BundleDescription desc) {
25         if (desc != null) {
26             // don't return any callers for fragments (since no one can depend on a fragment
27
if (desc.getHost() == null) {
28                 BundleDescription[] dependents = desc.getDependents();
29                 return Arrays.asList(dependents);
30             }
31         }
32         return Collections.EMPTY_LIST;
33     }
34
35 }
36
Popular Tags