getting a resource from java (Markers) [message #162082] |
Mon, 31 May 2004 04:04  |
Eclipse User |
|
|
|
Originally posted by: sergiolopes.gdnmail.net
Hello all.
I'm having a problem with markers and java. I'm making a visitor to
discover several situations in java code, wich i then want to let the user
know through markers.
My problem is that it seems i'm not capable of getting a resource inside
my java classes in order to use the Markers.
Here's what i'm doing:
I get and IEditorPart. After getting the IEditorPart, i'm able to obtain a
IWorkingCopyManager and a IEditorInput:
IWorkingCopyManager manager = JavaUI.getWorkingCopyManager();
IEditorInput editorInput = cuEditor.getEditorInput();
Then, i get the ICompilationUnit.
ICompilationUnit cu =
manager.getWorkingCopy(cuEditor.getEditorInput());
At this point, if i try any one of this methods that return a Resource, i
get null as a result from all of them:
cu.getResource();
cu.getCorrespondingResource();
cu.getUnderlyingResource();
Then i go on to processing java code with the visitor:
CompilationUnit cuu=AST.parseCompilationUnit(this.cu, true);
cuu.accept(this);
The visitor part seems alright because i can detect what i want and send
it to the console.
I'm really bugged with this. I must be doing something wrong or not doing
what i'm supposed to be doing. Any one can help me?
Thxs in advance.
Sergio
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04028 seconds