Search in sources :

Example 1 with JAXPDebugTarget

use of org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget in project webtools.sourceediting by eclipse.

the class ResultView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    this.sv = createViewer(parent);
    // handle any launches already added
    IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
    for (IDebugTarget debugTarget : targets) {
        if (debugTarget instanceof JAXPDebugTarget) {
            handleDebugTarget((JAXPDebugTarget) debugTarget);
        }
    }
    // listen to further launches
    DebugPlugin.getDefault().addDebugEventListener(this);
}
Also used : JAXPDebugTarget(org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget)

Example 2 with JAXPDebugTarget

use of org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget in project webtools.sourceediting by eclipse.

the class JAXPJavaLaunchConfigurationDelegate method launch.

@Override
public synchronized void launch(ILaunchConfiguration configuration, final String mode, final ILaunch launch, IProgressMonitor monitor) throws CoreException {
    this.mode = mode;
    launchHelper.save(getLaunchConfigFile());
    // set the launch name
    IProcessorInstall install = getProcessorInstall(configuration, mode);
    String tfactory = getTransformerFactory(install);
    String name = install.getName();
    if (tfactory != null)
        // $NON-NLS-1$//$NON-NLS-2$
        name += "[" + tfactory + "]";
    // $NON-NLS-1$
    launch.setAttribute("launchName", name);
    // the super.launch will add a Java source director if we set it to null
    // here
    final ISourceLocator configuredLocator = launch.getSourceLocator();
    launch.setSourceLocator(null);
    super.launch(configuration, mode, launch, monitor);
    // now get the java source locator
    final ISourceLocator javaSourceLookupDirector = launch.getSourceLocator();
    // now add our own participant to the java director
    launch.setSourceLocator(new ISourceLocator() {

        public Object getSourceElement(IStackFrame stackFrame) {
            // simply look at one and then the other
            Object sourceElement = javaSourceLookupDirector.getSourceElement(stackFrame);
            if (sourceElement == null)
                sourceElement = configuredLocator.getSourceElement(stackFrame);
            return sourceElement;
        }
    });
    // IJavaDebugTarget javaTarget =
    // (IJavaDebugTarget)launch.getDebugTarget();
    // launch.removeDebugTarget(javaTarget);
    IDebugTarget javaTarget = launch.getDebugTarget();
    IDebugTarget xslTarget = new JAXPDebugTarget(launch, launch.getProcesses()[0], launchHelper);
    // remove java as the primary target and make xsl the primary target
    launch.removeDebugTarget(javaTarget);
    launch.addDebugTarget(xslTarget);
// add this here to make java the non-primary target
// launch.addDebugTarget(javaTarget);
// launch.addDebugTarget(new JavaXSLDebugTarget(launch,
// launch.getProcesses()[0], launchHelper, javaTarget));
}
Also used : JAXPDebugTarget(org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget) IStackFrame(org.eclipse.debug.core.model.IStackFrame) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) ISourceLocator(org.eclipse.debug.core.model.ISourceLocator)

Aggregations

IDebugTarget (org.eclipse.debug.core.model.IDebugTarget)2 JAXPDebugTarget (org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget)2 ISourceLocator (org.eclipse.debug.core.model.ISourceLocator)1 IStackFrame (org.eclipse.debug.core.model.IStackFrame)1 IProcessorInstall (org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)1