Java 类org.eclipse.debug.core.model.ISourceLocator 实例源码

项目:gerrit-tools    文件:BranchOperationUI.java   
private ILaunchConfiguration getRunningLaunchConfiguration() {
    Set<IProject> projects = new HashSet<IProject>(
            Arrays.asList(ProjectUtil.getProjects(repository)));

    ILaunchManager launchManager = DebugPlugin.getDefault()
            .getLaunchManager();
    ILaunch[] launches = launchManager.getLaunches();
    for (ILaunch launch : launches) {
        if (launch.isTerminated())
            continue;
        ISourceLocator locator = launch.getSourceLocator();
        if (locator instanceof ISourceLookupDirector) {
            ISourceLookupDirector director = (ISourceLookupDirector) locator;
            ISourceContainer[] containers = director.getSourceContainers();
            if (isAnyProjectInSourceContainers(containers, projects))
                return launch.getLaunchConfiguration();
        }
    }
    return null;
}
项目:chromedevtools    文件:ChromiumRemoteTab.java   
private ISourceLookupDirector read(ILaunchConfiguration config) throws CoreException {
  String memento = config.getAttribute(
      ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
  if (memento == null) {
    return null;
  }
  String type = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
  if (type == null) {
    type = config.getType().getSourceLocatorId();
  }
  ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
  ISourceLocator locator = launchManager.newSourceLocator(type);
  if (locator instanceof IPersistableSourceLocator2 == false) {
    return null;
  }
  ISourceLookupDirector director = (ISourceLookupDirector) locator;
  director.initializeFromMemento(memento, config);
  return director;
}
项目:goclipse    文件:GoDebugLaunchConfigurationDelegate.java   
@Override
protected GdbLaunchDelegateExtension createGdbLaunchDelegate() {
    return new GdbLaunchDelegateExtension() {
        @Override
        protected GdbLaunch createGdbLaunch(ILaunchConfiguration configuration, String mode, ISourceLocator locator)
                throws CoreException {
            return doCreateGdbLaunch(configuration, mode, locator);
        }

        @Override
        protected LangDebugServicesExtensions createServicesExtensions(
                IDsfDebugServicesFactory parentServiceFactory) {
            return new GoDebugServicesExtensions(parentServiceFactory);
        };
    };
}
项目:eclipse-weblogic-plugin    文件:WeblogicLauncher.java   
/**
 * @param label
 * @param classToLaunch
 * @param classpath
 * @param bootClasspath
 * @param vmArgs
 * @param prgArgs
 * @param workDir
 * @param sourceLocator
 * @param debug
 * @param showInDebugger
 * @throws CoreException
 */
public void runVM(final String label, final String classToLaunch, final String[] classpath, final String[] bootClasspath, final String[] vmArgs,
        final String[] prgArgs, final String workDir, final ISourceLocator sourceLocator, final boolean debug, final boolean showInDebugger)
        throws CoreException {
    final IVMInstall vmInstall = this.getVMInstall();
    String mode = ILaunchManager.DEBUG_MODE;
    if (debug && classToLaunch.equals(WEBLOGIC_MAIN_CLASS)) {
        mode = ILaunchManager.DEBUG_MODE;
    } else {
        mode = ILaunchManager.RUN_MODE;
    }
    final IVMRunner vmRunner = vmInstall.getVMRunner(mode);

    final ILaunchConfigurationType launchType = DebugPlugin.getDefault().getLaunchManager()
            .getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
    final ILaunchConfigurationWorkingCopy config = launchType.newInstance(null, label);
    config.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
    config.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector");
    DebugUITools.setLaunchPerspective(launchType, mode, IDebugUIConstants.PERSPECTIVE_DEFAULT);
    final Launch launch = new Launch(config, mode, sourceLocator);

    config.doSave();
    if (vmRunner != null) {
        final VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(classToLaunch, classpath);
        vmConfig.setVMArguments(vmArgs);
        vmConfig.setProgramArguments(prgArgs);
        if (workDir != null) {
            vmConfig.setWorkingDirectory(workDir);
        }
        if (bootClasspath.length == 0) {
            vmConfig.setBootClassPath(null);
        } else {
            vmConfig.setBootClassPath(bootClasspath);
        }
        vmRunner.run(vmConfig, launch, null);
    }
    if (showInDebugger) {
        DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
    }
}
项目:pandionj    文件:PandionJView.java   
public void handleDebugEvents(DebugEvent[] events) {
    if(events.length > 0 && runtime != null && !runtime.isTerminated()) {
        DebugEvent e = events[0];
        PandionJUI.executeUpdate(() -> {
            if(e.getKind() == DebugEvent.SUSPEND && e.getDetail() == DebugEvent.STEP_END && exception == null) {
                IJavaThread thread = (IJavaThread) e.getSource();       
                IStackFrame f = thread.getTopStackFrame();
                if(f == null)
                    return;
                ISourceLocator sourceLocator = f.getLaunch().getSourceLocator();
                Object sourceElement = sourceLocator == null ? null : sourceLocator.getSourceElement(f);

                if(sourceElement != null) {
                    if(sourceElement instanceof IFile)
                        handleFrames(thread);
                    else
                        thread.stepReturn();
                    if(f != null && f.getLineNumber() == -1)
                        thread.resume(); // to jump over injected code
                }
                else {
                    thread.stepReturn();
                }

                //                      Job job = Job.create("Update table", (ICoreRunnable) monitor -> {
                //                          System.out.println("STEP");
                //                          thread.stepInto();
                //                      });
                //                      job.schedule(3000);

            }
            else if(e.getKind() == DebugEvent.CHANGE && e.getDetail() == DebugEvent.CONTENT) {
                runtime = new RuntimeModel();
                runtimeView.setInput(runtime);
            }
            else if(e.getKind() == DebugEvent.TERMINATE && e.getSource() instanceof RuntimeProcess) {
                runtime.setTerminated();
            }
        });
    }
}
项目:google-cloud-eclipse    文件:MockLaunch.java   
@Override
public ISourceLocator getSourceLocator() {
    return sourceLocator;
}
项目:google-cloud-eclipse    文件:MockLaunch.java   
@Override
public void setSourceLocator(ISourceLocator locator) {
    sourceLocator = locator;
}
项目:eclipse-extras    文件:TestLaunch.java   
public TestLaunch( ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator ) {
  super( launchConfiguration, mode, locator );
}
项目:gwt-eclipse-plugin    文件:MockILaunch.java   
public ISourceLocator getSourceLocator() {
  return null;
}
项目:gwt-eclipse-plugin    文件:MockILaunch.java   
public void setSourceLocator(ISourceLocator sourceLocator) {
}
项目:goclipse    文件:GdbLaunchDelegateExtension.java   
@Override
protected ISourceLocator getSourceLocator(ILaunchConfiguration configuration, DsfSession session)
        throws CoreException {
    return super.getSourceLocator(configuration, session);
}
项目:goclipse    文件:AbstractLangDebugLaunchConfigurationDelegate.java   
@Override
protected GdbLaunch createGdbLaunch(ILaunchConfiguration configuration, String mode,
        ISourceLocator locator) throws CoreException {
    return doCreateGdbLaunch(configuration, mode, locator);
}
项目:goclipse    文件:AbstractLangDebugLaunchConfigurationDelegate.java   
protected abstract GdbLaunch doCreateGdbLaunch(ILaunchConfiguration configuration, String mode,
ISourceLocator locator);
项目:goclipse    文件:GoDebugLaunchConfigurationDelegate.java   
@Override
protected GdbLaunch doCreateGdbLaunch(ILaunchConfiguration configuration, String mode, ISourceLocator locator) {
    return new GoGdbLaunch(configuration, mode, locator);
}
项目:goclipse    文件:GoGdbLaunch.java   
protected GoGdbLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
    super(launchConfiguration, mode, locator);
}
项目:smaccm    文件:SimulationLaunch.java   
public SimulationLaunch(final ILaunchConfiguration launchConfiguration, final String mode, final ISourceLocator locator) {
    super(launchConfiguration, mode, locator);
}