}
}
if (javaElement instanceof ICompilationUnit || javaElement instanceof IClassFile) {
try {
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { javaElement}, false);
MainMethodSearchEngine engine = new MainMethodSearchEngine();
IType[] types = engine.searchMainMethods(getLaunchConfigurationDialog(), scope,
IJavaElementSearchConstants.CONSIDER_BINARIES | IJavaElementSearchConstants.CONSIDER_EXTERNAL_JARS);
if (types != null && (types.length > 0)) {
// Simply grab the first main type found in the searched
// element
name = types[0].getFullyQualifiedName();