[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Class full name to Source full name

IProject project;  // your eclipse project
IJavaProject javaProject = JavaCore.create(project);
IType type = javaProject.findType("java.util.Calendar");
JavaUI.openInEditor(type);


Yao Qi wrote:
I could get the class name as input, and then I want to open the source file in
editor if any.

For example, if input is "java.until.Calendar", this source file could
be opened in JDT editor.

I googled for some time, and find that IClassFile, IPackageFragment, and ISourceReference may help me. However I do not know how to use these
classes to get what I want.


Am I on a right track?  If yes, is there any sample code to tell me how
to use these classes?  I a newbie here, and thanks in advance for your
comments on this.

Best Regards