blob: bda39b9d03bbeee17ef098d7226a4589faa7e10d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* (report 36180: Callers/Callees view)
*******************************************************************************/
package org.eclipse.dltk.internal.corext.callhierarchy;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.dltk.core.IMember;
import org.eclipse.dltk.core.IModelElement;
/**
* The main plugin class to be used in the desktop.
*/
public class Implementors {
private static Implementors fgInstance;
/**
* Returns the shared instance.
*/
public static synchronized Implementors getInstance() {
if (fgInstance == null) {
fgInstance = new Implementors();
}
return fgInstance;
}
/**
* Searches for implementors of the specified Script elements. Currently, only IMethod
* instances are searched for. Also, only the first element of the elements
* parameter is taken into consideration.
*
* @param elements
*
* @return An array of found implementing Script elements (currently only IMethod
* instances)
*/
public IModelElement[] searchForImplementors(IModelElement[] elements,
IProgressMonitor progressMonitor) {
if ((elements != null) && (elements.length > 0)) {
IModelElement element = elements[0];
// try {
if (element instanceof IMember) {
//IMember member = (IMember) element;
// IType type = member.getDeclaringType();
// if (type.isInterface()) {
// IType[] implementingTypes = findImplementingTypes(type,
// progressMonitor);
//
// if (member.getElementType() == IModelElement.METHOD) {
// return findMethods((IMethod)member, implementingTypes, progressMonitor);
// } else {
// return implementingTypes;
// }
// }
}
// } catch (ModelException e) {
// DLTKUIPlugin.log(e);
// }
}
return null;
}
}