use of org.eclipse.wst.xsl.jaxp.launching.IProcessorJar in project webtools.sourceediting by eclipse.
the class JarLabelProvider method getText.
@Override
public String getText(Object element) {
IProcessorJar jar = (IProcessorJar) element;
IPath path = jar.getPath();
// $NON-NLS-1$ //$NON-NLS-2$
return path.lastSegment() + " - " + path.removeLastSegments(1).toOSString() + "";
}
use of org.eclipse.wst.xsl.jaxp.launching.IProcessorJar in project webtools.sourceediting by eclipse.
the class ProcessorLibraryBlock method addExternal.
private void addExternal(IStructuredSelection selection) {
IDialogSettings dialogSettings = XSLDebugUIPlugin.getDefault().getDialogSettings();
String lastUsedPath = dialogSettings.get(LAST_PATH_SETTING);
if (lastUsedPath == null) {
// $NON-NLS-1$
lastUsedPath = "";
}
FileDialog dialog = new FileDialog(tableViewer.getControl().getShell(), SWT.MULTI);
dialog.setText(Messages.ProcessorLibraryBlock_FileDialog_Title);
dialog.setFilterExtensions(new String[] // $NON-NLS-1$
{ "*.jar;*.zip" });
dialog.setFilterPath(lastUsedPath);
String res = dialog.open();
if (res == null) {
return;
}
String[] fileNames = dialog.getFileNames();
int nChosen = fileNames.length;
IPath filterPath = new Path(dialog.getFilterPath());
IProcessorJar[] libs = new IProcessorJar[nChosen];
for (int i = 0; i < nChosen; i++) {
libs[i] = JAXPRuntime.createProcessorJar(filterPath.append(fileNames[i]).makeAbsolute());
}
dialogSettings.put(LAST_PATH_SETTING, filterPath.toOSString());
IProcessorJar[] currentJars = install.getProcessorJars();
IProcessorJar[] newJars = new IProcessorJar[currentJars.length + libs.length];
System.arraycopy(currentJars, 0, newJars, 0, currentJars.length);
System.arraycopy(libs, 0, newJars, currentJars.length, libs.length);
install.setProcessorJars(newJars);
tableViewer.add(libs);
}
use of org.eclipse.wst.xsl.jaxp.launching.IProcessorJar 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