Force Refresh of Project Classpath Status [message #648946] |
Sun, 16 January 2011 06:22  |
Eclipse User |
|
|
|
Background:
I am writing plug-ins which allow for the creation of a specific type of Java project, and add a custom classpath. These plug-ins also include views which access the Java model and display project data.
Problem:
The libraries the classpath references can become "missing" - however, there is already code in place to resolve the issue, which automatically checks for it and executes when the problem is detected. However, in order for the errors relating to imports and classes not being found to be recognized as resolved, I must manually click in the package explorer window, and refresh. The views which display data about the project are unable to correctly display their data until this happens, as the java model cannot resolve the classes fully until then. What I wish to do is programmically, from within the plug-in, trigger that refresh. I am running the code which would do this from a seperate thread, however I can force code to execute form the display thread if necessary via Display.syncExec (or asyncExec).
Attempted Solutions:
I have tried using IResource.refreshLocal(DEPTH_INFINITE) on both the affect projects and the workspace as a whole
I have tried setRawClasspath(getRawClasspath) as suggested in the IJavaProject documentation
I have tried retrieving the PackageExplorerPart (successfully; the part i received was not null) and invoking its refresh method
None of these methods has resulted in the error symbols in the editor and on the project folder automatically being resolved once the code to fix the libraries is complete; and none of them has allowed the views to perform their task either. However, every time I was able to resolve the errors by refreshing the package explorer view.
Desired Result:
I wish to automatically handle the errors and have them automatically resolve (in the same way as refreshing the package explorer window) once the library has been dealt with.
Thanks in advance for any help you can offer
|
|
|
|
|
Re: Force Refresh of Project Classpath Status [message #648996 is a reply to message #648989] |
Mon, 17 January 2011 02:21  |
Eclipse User |
|
|
|
My issue is slightly different. I tried the build, and in combination with some information I gained from the bug report, I was able to make a solution. I will reevaluate the need for my code once 3.7 is released for general use.
Thanks you for your help!
|
|
|
Powered by
FUDForum. Page generated in 0.06282 seconds