A hook which can be run when a project is "opened" or "closed" in the GUI.
The meaning of these terms is intentionally left vague, but typically opening
a project signals that the user may wish to work with it, so it would be a good
idea to make sure caches are up to date, etc. It is perfectly possible to load
and use (even run) projects which are not open, so any project type
provider using this hook cannot rely on it for basic semantics.
XXX run with mutex read or write held?
ProjectOpenedHook.projectOpened and
ProjectOpenedHook.projectClosed are always called in pairs,
e.g. a project cannot be opened twice in a row without being closed in between.
Also a project left open at the end of one VM session will receive
ProjectOpenedHook.projectClosed before shutdown and (if an open project list is persisted)
ProjectOpenedHook.projectOpened sometime during the next startup.
An instance should be placed into a project's lookup to register it. (That means either
directly placed in the
org.netbeans.api.project.Project 's lookup or
in the
org.netbeans.spi.project.LookupProvider instance that extends the default
project's Lookup, if applicable to the specific project type.)
All instances found in the lookup will be notified on project open and close.
See Also: org.netbeans.api.project.Project.getLookup author: Jesse Glick |