KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > view > CalleesContentProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.view;
12
13 import org.eclipse.pde.core.plugin.IFragment;
14 import org.eclipse.pde.core.plugin.IPlugin;
15 import org.eclipse.pde.core.plugin.IPluginBase;
16 import org.eclipse.pde.core.plugin.IPluginImport;
17 import org.eclipse.pde.internal.core.PDECore;
18
19 public class CalleesContentProvider extends DependenciesViewPageContentProvider {
20     public CalleesContentProvider(DependenciesView view) {
21         super(view);
22     }
23
24     /**
25      * @param plugin
26      * @return
27      */

28     protected Object JavaDoc[] findCallees(IPluginBase plugin) {
29         if (plugin instanceof IFragment) {
30             String JavaDoc hostId = ((IFragment) plugin).getPluginId();
31             IPlugin hostPlugin = PDECore.getDefault().findPlugin(hostId);
32             if (hostPlugin != null) {
33                 IPluginImport[] imports = plugin.getImports();
34                 Object JavaDoc[] result = new Object JavaDoc[imports.length + 1];
35                 System.arraycopy(imports, 0, result, 0, imports.length);
36                 result[imports.length] = hostPlugin;
37                 return result;
38             }
39         }
40         return plugin.getImports();
41     }
42
43 }
44
Popular Tags