Use the Close All command in the Project menu to close all files in the active project. The result is the same as if you had used File|Close for each file in the project. The project itself remains open.
If the project is unmanaged, the files are removed from the project.
If the project is managed, files that are part of managed projects remain part of the project as closed files. The Files Panel and Search Panel can show and search through files that are closed but are still part of managed projects. Any outside files that were open under the project's tab are removed from the project, because they were never an actual part of the project.
Project|Remove From Project
Project|Remove Closed Files
Project|Close Outside Files
Project|Close All Files
File|Close All but Current