View Javadoc

1   /*
2    * $Id: KazukiRuntimeResolver.java,v 1.7 2004/09/20 03:51:50 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8   package com.bbn.swede.library.kazuki;
9   
10  import org.eclipse.core.runtime.CoreException;
11  import org.eclipse.core.runtime.Path;
12  import org.eclipse.debug.core.ILaunchConfiguration;
13  import org.eclipse.jdt.core.IClasspathEntry;
14  import org.eclipse.jdt.core.IJavaProject;
15  import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
16  import org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver;
17  import org.eclipse.jdt.launching.IVMInstall;
18  import org.eclipse.jdt.launching.JavaRuntime;
19  
20  /***
21   * Provides access to the Kazuki jars at runtime.
22   */
23  public class KazukiRuntimeResolver implements IRuntimeClasspathEntryResolver
24  {
25     /*
26      *  (non-Javadoc)
27      * @see org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver#resolveRuntimeClasspathEntry(
28      *       org.eclipse.jdt.launching.IRuntimeClasspathEntry, org.eclipse.debug.core.ILaunchConfiguration)
29      */
30     public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(
31        IRuntimeClasspathEntry entry,
32        ILaunchConfiguration configuration)
33        throws CoreException
34     {
35        String[] jars =
36           KazukiPlugin.getKazukiPlugin().getKazukiLibraryLocations();
37        IRuntimeClasspathEntry[] rtVal = new IRuntimeClasspathEntry[jars.length];
38        for (int i = 0; i < jars.length; i++)
39        {
40           rtVal[i] =
41              JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(jars[i]));
42        }
43        return rtVal;
44     }
45  
46     /*
47      *  (non-Javadoc)
48      * @see org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver#resolveRuntimeClasspathEntry(
49      *       org.eclipse.jdt.launching.IRuntimeClasspathEntry, org.eclipse.jdt.core.IJavaProject)
50      */
51     public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(
52        IRuntimeClasspathEntry entry,
53        IJavaProject project)
54        throws CoreException
55     {
56        String[] jars =
57           KazukiPlugin.getKazukiPlugin().getKazukiLibraryLocations();
58        IRuntimeClasspathEntry[] rtVal = new IRuntimeClasspathEntry[jars.length];
59        for (int i = 0; i < jars.length; i++)
60        {
61           rtVal[i] =
62              JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(jars[i]));
63        }
64        return rtVal;
65     }
66  
67     /*
68      *  (non-Javadoc)
69      * @see org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver#resolveVMInstall(
70      *       org.eclipse.jdt.core.IClasspathEntry)
71      */
72     public IVMInstall resolveVMInstall(IClasspathEntry entry)
73        throws CoreException
74     {
75        return null;
76     }
77  
78  }