Package org.eclipse.jdt.internal.debug.ui.launcher

Examples of org.eclipse.jdt.internal.debug.ui.launcher.MainMethodSearchEngine


        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;
View Full Code Here


    IJavaProject javaProject = getJavaProject();

    if (javaProject != null) {
      // Returns main method types
      boolean includeSubtypes = true;
      MainMethodSearchEngine engine = new MainMethodSearchEngine();
      int constraints = IJavaSearchScope.SOURCES;
      constraints |= IJavaSearchScope.APPLICATION_LIBRARIES;
      IJavaSearchScope scope = SearchEngine.createJavaSearchScope(
          new IJavaElement[] { javaProject }, constraints);
      return engine.searchMainMethods(monitor, scope, includeSubtypes);
    }
    return new IType[] {};

  }
View Full Code Here

      }
    }
    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, false);       
        if (types != null && (types.length > 0)) {
          // Simply grab the first main type found in the searched element
          name = types[0].getFullyQualifiedName();
        }
      } catch (InterruptedException ie) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.debug.ui.launcher.MainMethodSearchEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.