[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.jdt] Re: How to get a Reference to current Project
|
I used the following code to get java project for file :
IFile file = ....
ICompilationUnit unit =
JavaCore.createCompilationUnitFrom(file);
IJavaProject project = unit.getJavaProject();
"kronen" <kleinro@xxxxxxxxxxxxxx> wrote in message
news:chq5s2$eh6$1@xxxxxxxxxxxxxx
> Hello all,
>
> how do I get a reference to the project thath contains a java DebugTarget?
> (while my plugin is running and eclipse is debugging some other project).
>
> I tried to use code from here:
>
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaWatchExpressionDelegate.java?rev=1.5
>
> but surprisingly it didn't work... (for me?)
>
> anyway, I got a JavaStackFrame from the DebugUITools.getDebugContext().
> method,
> and from ISourceLocator I got a File object, but how do I get to the
> project containing this file? the File object's adapter didn't want to
> return me any IJavaElement for me to ask what is the IJavaProject.
>
> can you plz help me out?
>