|Force Refresh of Project Classpath Status [message #648946]
||Sun, 16 January 2011 11:22
| Ryan O'Meara
Registered: July 2009
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.
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).
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.
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
Powered by FUDForum
. Page generated in 0.01794 seconds