Search in sources :

Example 1 with ProcessorInstall

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

the class ProcessorRegistry method addPersistedVMs.

private void addPersistedVMs() {
    // Try retrieving the VM preferences from the preference store
    String vmXMLString = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPRuntime.PREF_PROCESSOR_XML);
    // If the preference was found, load VMs from it into memory
    if (vmXMLString.length() > 0) {
        try {
            ByteArrayInputStream inputStream = new ByteArrayInputStream(vmXMLString.getBytes());
            ProcessorPreferences prefs = ProcessorPreferences.fromXML(inputStream);
            String defaultProcessorId = prefs.getDefaultProcessorId();
            userInstalls = prefs.getProcessors();
            for (Iterator<IProcessorInstall> iter = userInstalls.iterator(); iter.hasNext(); ) {
                IProcessorInstall install = iter.next();
                if (install.getId().equals(defaultProcessorId)) {
                    defaultProcessor = install;
                }
            }
            if (defaultProcessor == null) {
                for (Iterator<ProcessorInstall> iter = contributedInstalls.iterator(); iter.hasNext(); ) {
                    IProcessorInstall install = iter.next();
                    if (defaultProcessor == null && install.getId().equals(defaultProcessorId)) {
                        defaultProcessor = install;
                    }
                }
            }
        } catch (CoreException e) {
            JAXPLaunchingPlugin.log(e);
        }
    }
    // make the JRE the default default
    if (defaultProcessor == null) {
        defaultProcessor = jreDefaultProcessor;
    }
}
Also used : ProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) CoreException(org.eclipse.core.runtime.CoreException) ByteArrayInputStream(java.io.ByteArrayInputStream) ProcessorPreferences(org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorPreferences) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)

Example 2 with ProcessorInstall

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

the class ProcessorRegistry method initializeFromStorage.

private void initializeFromStorage() {
    // read from the registry
    ProcessorRegistryReader registryReader = new ProcessorRegistryReader();
    registryReader.addConfigs(this);
    // find the jre default
    for (Iterator<ProcessorInstall> iter = contributedInstalls.iterator(); iter.hasNext(); ) {
        IProcessorInstall install = iter.next();
        if (install.getId().equals(JAXPRuntime.JRE_DEFAULT_PROCESSOR_ID)) {
            jreDefaultProcessor = install;
            break;
        }
    }
    // read from the preferences
    addPersistedVMs();
}
Also used : ProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)

Example 3 with ProcessorInstall

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

the class ProcessorRegistry method addProcessor.

public void addProcessor(String bundleId, String id, String label, String processorTypeId, String classpath, String debuggerId, String supports) {
    IProcessorJar[] jars = ProcessorInstall.createJars(bundleId, classpath);
    contributedInstalls.add(new ProcessorInstall(id, label, processorTypeId, jars, debuggerId, supports, true));
}
Also used : ProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall) IProcessorInstall(org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall) IProcessorJar(org.eclipse.wst.xsl.jaxp.launching.IProcessorJar)

Example 4 with ProcessorInstall

use of org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall 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)4 ProcessorInstall (org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall)4 IProcessorJar (org.eclipse.wst.xsl.jaxp.launching.IProcessorJar)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 CoreException (org.eclipse.core.runtime.CoreException)1 ProcessorPreferences (org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorPreferences)1 Element (org.w3c.dom.Element)1