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;
}
}
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();
}
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));
}
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;
}
Aggregations