protected void setSourceLocator(ILaunch launch) throws CoreException { ILaunchConfiguration configuration = launch.getLaunchConfiguration(); if (launch.getSourceLocator() == null) { ISourceLookupDirector sourceLocator = new JavaSourceLookupDirector(); ISourcePathComputer locator = getLaunchManager().getSourcePathComputer(SOURCE_LOCATOR); if (locator != null) { sourceLocator.setSourcePathComputer(locator); //$NON-NLS-1$ sourceLocator.initializeDefaults(configuration); launch.setSourceLocator(sourceLocator); } } }
/** * Assigns a default source locator to the given launch if a source locator * has not yet been assigned to it, and the associated launch configuration * does not specify a source locator. * * @param launch * launch object * @param configuration * configuration being launched * @exception CoreException * if unable to set the source locator */ protected void setDefaultSourceLocator(ILaunch launch, ILaunchConfiguration configuration) throws CoreException { // set default source locator if none specified if (launch.getSourceLocator() == null) { ISourceLookupDirector sourceLocator = new JavaSourceLookupDirector(); sourceLocator .setSourcePathComputer(getLaunchManager() .getSourcePathComputer( "org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer")); //$NON-NLS-1$ sourceLocator.initializeDefaults(configuration); launch.setSourceLocator(sourceLocator); } } /**
/** * Assigns a default source locator to the given launch if a source locator * has not yet been assigned to it, and the associated launch configuration * does not specify a source locator. * * @param launch * launch object * @param configuration * configuration being launched * @exception CoreException * if unable to set the source locator */ protected void setDefaultSourceLocator(ILaunch launch, ILaunchConfiguration configuration) throws CoreException { // set default source locator if none specified if (launch.getSourceLocator() == null) { ISourceLookupDirector sourceLocator = new JavaSourceLookupDirector(); sourceLocator .setSourcePathComputer(getLaunchManager() .getSourcePathComputer( "org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer")); //$NON-NLS-1$ sourceLocator.initializeDefaults(configuration); launch.setSourceLocator(sourceLocator); } } /**
@Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { // System.out.println("launching"); IDbgpService dbgpService = null; try { dbgpService = DLTKDebugPlugin.getDefault().getDbgpService(); IScriptDebugTarget target = new ScriptDebugTarget("org.apache.uima.ruta.ide.debug.rutaModel", dbgpService, "hello", launch, null); IOConsole cs = new IOConsole("aa", null); ScriptStreamProxy proxy = new ScriptStreamProxy(cs); target.setStreamProxy(proxy); launch.addDebugTarget(target); final ISourceLocator sourceLocator = launch.getSourceLocator(); final RutaSourceLookupDirector l = new RutaSourceLookupDirector(); launch.setSourceLocator(new ISourceLocator() { public Object getSourceElement(IStackFrame stackFrame) { Object sourceElement = sourceLocator.getSourceElement(stackFrame); if (sourceElement != null) return sourceElement; return l.getSourceElement(stackFrame); } }); } catch (Exception e) { } super.launch(configuration, mode, launch, monitor); }
/** * Set the source locator to use with the launch, if specified * by this configuration. * * @param launch the launch on which to set the source locator * @throws CoreException if a problem is encountered */ protected void initializeSourceLocator(ILaunch launch) throws CoreException { if (launch.getSourceLocator() == null) { String type = getAttribute(ATTR_SOURCE_LOCATOR_ID, (String)null); if (type == null) { type = getType().getSourceLocatorId(); } if (type != null) { IPersistableSourceLocator locator = getLaunchManager().newSourceLocator(type); String memento = getAttribute(ATTR_SOURCE_LOCATOR_MEMENTO, (String)null); if (memento == null) { locator.initializeDefaults(this); } else { if(locator instanceof IPersistableSourceLocator2) { ((IPersistableSourceLocator2)locator).initializeFromMemento(memento, this); } else { locator.initializeFromMemento(memento); } } launch.setSourceLocator(locator); } } }