Warning: this API is intended only for a limited set of use cases where obtaining a list of all open projects is really the direct goal. For example, you may wish to display a chooser letting the user select a file from among the top-level source folders of any open project. For many cases, however, this API is not the correct approach, so use it as a last resort. Consider GlobalPathRegistry, ProjectOpenedHook, and ui.support.ProjectSensitiveActions (or ui.support.MainProjectSensitiveActions) first. Only certain operations should actually be aware of which projects are "open"; by default, all project functionality should be available whether it is open or not.
Finds out if the project is opened.
Method to track progress of projects opening and closing.
Since 1.26, the standard implementation handling the list of opened projects, delays their actual loading. First of all the startup of all modules is finished and only then the projects are loaded and opened on background. As soon as and no sooner before all opened projects are opened, the return value of this method changes and appropriate property change event with PROPERTY_OPEN_PROJECTS is delivered.
This result is different that a plain call to getOpenProjects() as that methods returns the current state, whatever it is. While the call through the future awaits for current modifications to finish. As such wait can take a long time one can also wait for just a limited amount of time. However this waiting methods should very likely only be used from dedicated threads, where the wait does not block other essencial operations (read: do not use such methods from AWT or other known threads!).
Opens given projects. Acquires ProjectManager.mutex() in write mode.
This method is designed for uses such as a logical view's Libraries node to open a dependent project. It can also be used by other project GUI components which need to open certain project(s), e.g. code generation wizards. This should not be used for opening a newly created project; rather, WizardDescriptor.InstantiatingIterator should return the project directory. This should also not be used to provide a GUI to open subprojects; CommonProjectActions#openSubprojectsAction should be used instead.
projects - to be opened. If some of the projects are already opened these projects are ignored. If the list contain duplicates, the duplicated projects are opened just once.
showProgress - show progress dialog during the open, will run asynchronously in that case.
Warning: the set of usecases that require invoking this method is limited. ui.support.MainProjectSensitiveActions should be used in favour of this method if possible. In particular, this method should not be used to let the user choose if an action should be run on the main vs. the currently selected project.
As a rule of thumb, any code outside of the project system infrastructure which behaves differently depending on the choice of main project should be reviewed critically. All functionality of a project ought to be available regardless of the "main project" flag, which is intended only as a convenient shortcut to permit certain actions (such as Run) to be invoked from a global context on a preselected project.
Sets the main project. Should not generally be called programmatically; an exception would be when renaming a main project.
Warning: the set of usecases that require invoking this method is very limited and should be generally avoided if possible. In particular, this method should not be used to mark a project just created by the New Project wizard as the main project.