I’m developing an Eclipse plugin.
I have been reading how to subscribe get notification when a project is about to be closed, using the interface IResourceChangeListener, and using the PRE_CLOSE event type. The following text has been taken from the Eclipse help:
Notifies listeners that a project is about to be closed. This event
can be used to extract and save necessary information from the
in-memory representation (e.g., session properties) of a project
before it is closed. (When a project is closed, the in-memory
representation is disposed). The workspace is locked (no resources can
be updated) during this event. The event contains the project that is
being closed.
I didn’t found how to be notified when a project is about to be opened.
You can create your own
IResourceChangeListenerand filter the kind of delta byIResourceDelta.OPEN, which only affects to IProjects, and it’s fired both when opening and closing a project:Useful link:
http://www.eclipse.org/articles/Article-Resource-deltas/resource-deltas.html