Search in sources :

Example 21 with IProcessorInstall

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

the class JAXPJavaLaunchConfigurationDelegate method getProcessorInstall.

public static IProcessorInstall getProcessorInstall(ILaunchConfiguration configuration, String mode) throws CoreException {
    IProcessorInstall install = LaunchHelper.getProcessorInstall(configuration);
    if (mode.equals(ILaunchManager.DEBUG_MODE) && install.getDebugger() == null) {
        String debuggingInstallId = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPLaunchConfigurationConstants.ATTR_DEFAULT_DEBUGGING_INSTALL_ID);
        install = JAXPRuntime.getProcessor(debuggingInstallId);
    }
    return install;
}
Also used : IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)

Example 22 with IProcessorInstall

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

the class JAXPJavaLaunchConfigurationDelegate method getProgramArguments.

@Override
public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
    // classname, sourceurl, output file
    IProcessorInvoker invoker = getProcessorInvokerDescriptor(configuration);
    String clazz = invoker.getInvokerClassName();
    StringBuffer sb = new StringBuffer();
    sb.append(clazz);
    // $NON-NLS-1$
    sb.append(" ");
    // $NON-NLS-1$ //$NON-NLS-2$
    sb.append("\"" + getLaunchConfigFile().getAbsolutePath() + "\"");
    // $NON-NLS-1$
    sb.append(" ");
    // $NON-NLS-1$ //$NON-NLS-2$
    sb.append("\"" + launchHelper.getSource() + "\"");
    // $NON-NLS-1$
    sb.append(" ");
    // $NON-NLS-1$ //$NON-NLS-2$
    sb.append("\"" + launchHelper.getTarget().getAbsolutePath() + "\"");
    if (ILaunchManager.DEBUG_MODE.equals(mode)) {
        IProcessorInstall install = getProcessorInstall(configuration, mode);
        if (install.getDebugger() != null) {
            IDebugger debugger = install.getDebugger();
            String className = debugger.getClassName();
            // $NON-NLS-1$ //$NON-NLS-2$
            sb.append(" -debug ").append(className).append(" ");
            sb.append(launchHelper.getRequestPort());
            // $NON-NLS-1$
            sb.append(" ").append(launchHelper.getEventPort());
            // $NON-NLS-1$
            sb.append(" ").append(launchHelper.getGeneratePort());
        }
    }
    return sb.toString();
}
Also used : IProcessorInvoker(org.eclipse.wst.xsl.jaxp.launching.IProcessorInvoker) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) IDebugger(org.eclipse.wst.xsl.jaxp.launching.IDebugger)

Example 23 with IProcessorInstall

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

the class LaunchHelper method getProcessorInstall.

public static IProcessorInstall getProcessorInstall(ILaunchConfiguration configuration) throws CoreException {
    boolean useDefaultProcessor = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_DEFAULT_PROCESSOR, true);
    if (useDefaultProcessor)
        return JAXPRuntime.getDefaultProcessor();
    String processorId = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_PROCESSOR, // $NON-NLS-1$
    "");
    IProcessorInstall processor = JAXPRuntime.getProcessor(processorId);
    return processor;
}
Also used : IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)

Example 24 with IProcessorInstall

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

the class ProcessorPreferences method fromXML.

public static ProcessorPreferences fromXML(InputStream inputStream) throws CoreException {
    ProcessorPreferences prefs = new ProcessorPreferences();
    Document doc = PreferenceUtil.getDocument(inputStream);
    Element config = doc.getDocumentElement();
    // Populate the default VM-related fields
    // $NON-NLS-1$
    prefs.setDefaultProcessorId(config.getAttribute("defaultProcessor"));
    List<IProcessorInstall> processors = new ArrayList<IProcessorInstall>();
    // Traverse the parsed structure and populate the VMType to VM Map
    // $NON-NLS-1$
    Element[] processorEls = PreferenceUtil.getChildElements(config, "processor");
    for (int i = 0; i < processorEls.length; ++i) {
        IProcessorInstall processor = elementAsInstall(processorEls[i]);
        processors.add(processor);
    }
    prefs.setProcessors(processors);
    return prefs;
}
Also used : Element(org.w3c.dom.Element) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) ArrayList(java.util.ArrayList) Document(org.w3c.dom.Document)

Example 25 with IProcessorInstall

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

the class ProcessorPreferences method elementAsInstall.

private static IProcessorInstall elementAsInstall(Element parent) {
    // $NON-NLS-1$
    String id = parent.getAttribute("id");
    // $NON-NLS-1$
    String label = parent.getAttribute("label");
    // $NON-NLS-1$
    String typeId = parent.getAttribute("type");
    // $NON-NLS-1$
    String supports = parent.getAttribute("supports");
    // $NON-NLS-1$
    String debuggerId = parent.getAttribute("debuggerId");
    IProcessorJar[] jars = null;
    // $NON-NLS-1$
    Element[] jarsEls = PreferenceUtil.getChildElements(parent, "jars");
    if (jarsEls.length == 1) {
        jars = elementAsJars(jarsEls[0]);
    }
    IProcessorInstall install = new ProcessorInstall(id, label, typeId, jars, debuggerId, supports, false);
    return install;
}
Also used : ProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) Element(org.w3c.dom.Element) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) IProcessorJar(org.eclipse.wst.xsl.jaxp.launching.IProcessorJar)

Aggregations

IProcessorInstall (org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)26 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)6 ArrayList (java.util.ArrayList)4 CoreException (org.eclipse.core.runtime.CoreException)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 ProcessorInstall (org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 Font (org.eclipse.swt.graphics.Font)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 IProcessorInvoker (org.eclipse.wst.xsl.jaxp.launching.IProcessorInvoker)2 IProcessorJar (org.eclipse.wst.xsl.jaxp.launching.IProcessorJar)2 IProcessorType (org.eclipse.wst.xsl.jaxp.launching.IProcessorType)2 ITransformerFactory (org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory)2 Element (org.w3c.dom.Element)2