Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Find the IType for a class
Find the IType for a class [message #246497] Fri, 03 August 2007 04:20 Go to next message
Eclipse UserFriend
Originally posted by: rupinder10.gmail.com

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 ?
Re: Find the IType for a class [message #246501 is a reply to message #246497] Fri, 03 August 2007 08:15 Go to previous messageGo to next message
Frederic Fusier is currently offline Frederic FusierFriend
Messages: 147
Registered: July 2009
Senior Member
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 ?
Re: Find the IType for a class [message #246521 is a reply to message #246501] Fri, 03 August 2007 22:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rupinder10.gmail.com

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 ?
Re: Find the IType for a class [message #246526 is a reply to message #246521] Sat, 04 August 2007 09:13 Go to previous messageGo to next message
Frederic Fusier is currently offline Frederic FusierFriend
Messages: 147
Registered: July 2009
Senior Member
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 ?
Re: Find the IType for a class [message #246745 is a reply to message #246526] Sun, 12 August 2007 02:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rupinder10.gmail.com

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 ?
Re: Find the IType for a class [message #246749 is a reply to message #246745] Sun, 12 August 2007 09:08 Go to previous message
Frederic Fusier is currently offline Frederic FusierFriend
Messages: 147
Registered: July 2009
Senior Member
So if you are using a Java Nature, what did you mean by "The actual test class is on the plugin's classpath" ?

Rupinder wrote:
> 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 ?
Previous Topic:problems of resourcesplugin.getworkspace()
Next Topic:API for finding the plugin providing a given class?
Goto Forum:
  


Current Time: Tue Apr 23 13:49:24 GMT 2024

Powered by FUDForum. Page generated in 0.03330 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top