use of org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall 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.IProcessorInstall 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.IProcessorInstall in project webtools.sourceediting by eclipse.
the class ProcessorRegistry method removeProcessor.
public void removeProcessor(int index) {
IProcessorInstall removed = installs[index];
if (!removed.isContributed())
userInstalls.remove(removed);
IProcessorInstall[] newinstalls = new IProcessorInstall[installs.length - 1];
System.arraycopy(installs, 0, newinstalls, 0, index);
System.arraycopy(installs, index + 1, newinstalls, index, newinstalls.length - index);
installs = newinstalls;
}
use of org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall in project webtools.sourceediting by eclipse.
the class InstalledProcessorsBlock method editProcessor.
private void editProcessor() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
IProcessorInstall install = (IProcessorInstall) selection.getFirstElement();
if (install == null) {
return;
}
if (!install.isContributed()) {
// ProcessorDetailsDialog dialog = new ProcessorDetailsDialog(getShell(), install);
// dialog.open();
// }
// else
// {
AddProcessorDialog dialog = new AddProcessorDialog(this, getShell(), JAXPRuntime.getProcessorTypesExclJREDefault(), install);
dialog.setTitle(Messages.AddProcessorDialog_Edit_Title);
if (dialog.open() != Window.OK) {
return;
}
// fillWithWorkspaceProcessors();
tableViewer.refresh();
}
}
use of org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall in project webtools.sourceediting by eclipse.
the class InstalledProcessorsBlock method enableButtons.
private void enableButtons() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
int selectionCount = selection.size();
fEditButton.setEnabled(selectionCount == 1 && !((IProcessorInstall) selection.getFirstElement()).isContributed());
if (selectionCount > 0 && selectionCount < tableViewer.getTable().getItemCount()) {
Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
IProcessorInstall install = (IProcessorInstall) iterator.next();
if (install.isContributed()) {
fRemoveButton.setEnabled(false);
return;
}
}
fRemoveButton.setEnabled(true);
} else {
fRemoveButton.setEnabled(false);
}
}
Aggregations