[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Find the IType for a class

I do not see it on the Plug-in Dependencies folder. But I guess that is because I am planning to use the Java nature.

Frederic Fusier wrote:
If the class file is on the plugins classpath, then PDE should have put the
corresponding jar file on your project classpath through the PDE Container
and so, you should see this jar under the 'Plug-in Dependencies' folder in
the Package Explorer... Can you see it there?

If you do not see it, then I assume that the nature of your project is not
correct. What kind of nature did you intend to apply to your project:
Java, Plug-in, other?

Rupinder wrote:
You are correct about the fact that project.findType does find the classes in the project. But in my case, the class file is not on the project's classpath but is in the plugins classpath.

The project just has an XML file. What I am trying to do is that when the use right click's the file to run it (yes run an XML file) the plugin should use the XML file to create test cases and run them. The actual test class is on the plugin's classpath and I dont want the users to have to unnecessarily include jar files in their project because they are not writing java code.

Frederic Fusier wrote:
The IJavaProject.findType(String) method should find any type which is on
the project classpath. So, if your jar is on your project classpath (it should
be the case, I guess), then you could use this method to find any type in it.


If you cannot find a type in your jar although it is on your classpath, then
first verify that the given name is well qualified or that it is not a secondary
type (see javadoc comment of the method). If the given parameter is correct
then open a bug against JDT/Core component with a detailed description of your
project configuration, the jar file containing the type you're trying to find
using this method, thanks


Rupinder wrote:
I am trying to write a plugin that needs its launcher to extend the JUnitLaunchConfiguration. Unfortunately, the JUnitLaunchConfiguration uses

project.findType(className)

to the IType of the test class to be launched. In my case the test class I want to launch is not a part of the project but is in the plugin jar. Is there a way for me to get to the IType if the class file is in the plugin and not the java project ?