Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-ui-dev] (no subject)


This question would be better in the JDT's mailing list.

To save you time on this question, here should be one way to do it:

1. get the String that represents the class/package
2. call .replace('.','/') on the String and store the new value
3. get an instance of the IProject, and call .findMember(<value from step 2>)
If the resource does not exist, the value will be null.  Otherwise, it will be the IFile or IContainer you are looking for.

That should be what you need.

Brian Bauman
    IBM Software Group - Austin, TX
    Eclipse Committer
    baumanbr@xxxxxxxxxx
    (512) 838 -2938 (T/L 678-2938)



"Ajaneesh Rajashekharaiah" <ajaneesh@xxxxxxxxxxxxxxxx>
Sent by: pde-ui-dev-bounces@xxxxxxxxxxx

01/08/2007 05:26 AM

Please respond to
"Eclipse PDE UI developers list." <pde-ui-dev@xxxxxxxxxxx>

To
<pde-ui-dev@xxxxxxxxxxx>
cc
Subject
[pde-ui-dev] (no subject)





Hi,
 
How can I create a resource out of a java package/class definition?  
 
Eg. How can I resolve the string “com.comp.foo” to an instance of IFolder at project1/src/com/comp/foo.  
OR
“com.comp.foo.Test” to an instance of IFile at project1/src/com/comp/foo/Test.java?
 
Any help with this will be greatly appreciated.
 
Warm Regards
Ajaneesh
 
 

============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.

Disclaimer:

This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at
http://www.techmahindra.com/Disclaimer.html externally and http://tim.techmahindra.com/Disclaimer.html internally within Tech Mahindra.

============================================================================================================================

_______________________________________________
pde-ui-dev mailing list
pde-ui-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pde-ui-dev


Back to the top