When is a newly imported project ready to read? [message #56024] |
Thu, 16 April 2009 16:07 |
Iain Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm writing a plugin that is a view on resources in a project, and it's
mostly working fine.
I'm trying to solve the case when my view is open, there are no projects
in the workspace, then a suitable project is imported.
When my view is opened with no suitable projects in the workspace, it
displays a simple 'nothing found' label. Once a suitable project has been
imported, it should change to its normal state.
I've got a Resource Change Listener, but I found that if I tried to add
projects in response to the ADDED event for a project (in a Runnable, so
the update happens once the resourceChanged() method has finished so the
workspace isn't locked), then I couldn't read any files in that project.
Anyway, I noticed that right after the ADDED event for a given project, a
CHANGE event happens when all of its resources are added to it.
So, what I've done (and it seems to work) is:
Queue up any projects found in the ADDED event.
If the same projects are then found in a CHANGED event, process them (in a
Runnable)
What I'd like to know is, have I done this the right way, or is there
another way to be notified when a newly imported project is ready to be
read?
Thanks
Iain
|
|
|
Powered by
FUDForum. Page generated in 0.03113 seconds