Search in sources :

Example 6 with IProcessorJar

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() + "";
}
Also used : IPath(org.eclipse.core.runtime.IPath) IProcessorJar(org.eclipse.wst.xsl.jaxp.launching.IProcessorJar)

Example 7 with IProcessorJar

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);
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) IProcessorJar(org.eclipse.wst.xsl.jaxp.launching.IProcessorJar) FileDialog(org.eclipse.swt.widgets.FileDialog)

Example 8 with IProcessorJar

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;
}
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

IProcessorJar (org.eclipse.wst.xsl.jaxp.launching.IProcessorJar)8 IPath (org.eclipse.core.runtime.IPath)3 IProcessorInstall (org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall)3 Element (org.w3c.dom.Element)3 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)2 ProcessorInstall (org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall)2 Text (org.w3c.dom.Text)2 File (java.io.File)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 IContainer (org.eclipse.core.resources.IContainer)1 IFile (org.eclipse.core.resources.IFile)1 CoreException (org.eclipse.core.runtime.CoreException)1 IStatus (org.eclipse.core.runtime.IStatus)1 Path (org.eclipse.core.runtime.Path)1 Status (org.eclipse.core.runtime.Status)1 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)1