ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
if (search != null) {
try {
IJavaElement[] elements = getJavaElements(search);
MainMethodSearchEngine engine = new MainMethodSearchEngine();
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements, false);
// TODO styling information was removed
// types = engine.searchMainMethods(dialog, scope, IJavaElementSearchConstants.CONSIDER_BINARIES
// | IJavaElementSearchConstants.CONSIDER_EXTERNAL_JARS, true);
types = engine.searchMainMethods(dialog, scope, true);
} catch (InterruptedException e) {
return;
} catch (InvocationTargetException e) {
MessageDialog.openError(getShell(), "Launch failed", e.getMessage());
return;