Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to add java project's classpath to a plug-in's classpath?(How to add java project's classpath to a plug-in's classpath?)
How to add java project's classpath to a plug-in's classpath? [message #636242] Fri, 29 October 2010 16:01 Go to next message
Márcio Dantas is currently offline Márcio Dantas
Messages: 4
Registered: October 2010
Junior Member
People,

I did a plugin that writes junit test cases from java source code.

By now, I'm starting to use reflection in my code, but the plugin can't find the classes in the java project being tested!

Is there a way to use the selected project classpath in my plug-in? How??

best regards
Re: How to add java project's classpath to a plug-in's classpath? [message #636456 is a reply to message #636242] Mon, 01 November 2010 08:51 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Márcio Dantas wrote:
> People,
>
> I did a plugin that writes junit test cases from java source code.
>
> By now, I'm starting to use reflection in my code, but the plugin can't
> find the classes in the java project being tested!

No, your plugin can't see stuff from a workspace through reflection, as
it hasn't been loaded into a class loader.

To manipulate a java project in a workspace from your plugin, you need
to use the JDT APIs. Like using AST to create the JUnit classes, etc.

Please have a look at the JDT Plug-in Developers Guide, and see
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. jdt.doc.isv/guide/jdt_api_manip.htm


PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: How to add java project's classpath to a plug-in's classpath? [message #636474 is a reply to message #636456] Mon, 01 November 2010 10:06 Go to previous message
Márcio Dantas is currently offline Márcio Dantas
Messages: 4
Registered: October 2010
Junior Member
Hi Paul,

thanks a lot for introducing me to JDT.
I find out that many things I implemented was already done there.

A question: does JDT AST parser provide the execution paths of a method?
Previous Topic:Expand the properties popup menu
Next Topic:FormEditor and canLeaveThePage
Goto Forum:
  


Current Time: Fri Aug 22 11:58:44 EDT 2014

Powered by FUDForum. Page generated in 0.03285 seconds