| java.lang.Object org.netbeans.api.project.ui.OpenProjects
PROPERTY_MAIN_PROJECT | final public static String PROPERTY_MAIN_PROJECT(Code) | | Property representing main project.
See Also: OpenProjects.getMainProject since: org.netbeans.modules.projectuiapi/1 1.20 |
addPropertyChangeListener | public void addPropertyChangeListener(PropertyChangeListener listener)(Code) | | Adds a listener to changes in the set of open projects.
As this class is a singleton and is not subject to garbage collection,
it is recommended to add only weak listeners, or remove regular listeners reliably.
Parameters: listener - a listener to add See Also: OpenProjects.PROPERTY_OPEN_PROJECTS |
close | public void close(Project[] projects)(Code) | | Closes given projects.
Acquires
org.netbeans.api.project.ProjectManager.mutex in the write mode.
Parameters: projects - to be closed. The non opened project contained in the projects array are ignored. since: org.netbeans.modules.projectuiapi/0 1.2 |
getDefault | public static OpenProjects getDefault()(Code) | | Get the default singleton instance of this class.
the default instance |
getMainProject | public Project getMainProject()(Code) | | Retrieves the current main project set in the IDE.
Warning: the set of usecases that require invoking this method is
limited.
org.netbeans.spi.project.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.
the current main project or null if none since: 1.11 |
getOpenProjects | public Project[] getOpenProjects()(Code) | | Gets a list of currently open projects.
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.
list of projects currently opened in the IDE's GUI; order not specified |
open | public void open(Project[] projects, boolean openSubprojects)(Code) | | Opens given projects.
Acquires
org.netbeans.api.project.ProjectManager.mutex in the write mode.
Parameters: projects - to be opened. In the case when some of the projects are already openedthese projects are not opened again. If the projects contain duplicates, the duplicatedprojects are opened just once. Parameters: openSubprojects - if true also subprojects are opened. since: org.netbeans.modules.projectuiapi/0 1.2 since: since: This method is designed for use by logical view's Libraries Node to open one or more of dependent since: projects. This method can be used also by other project GUI components which need to open certain since: project(s), eg. code generation wizards.
since: The method should not be used for opening newly created project, insted theorg.openide.WizardDescriptor.InstantiatingIterator.instantiate since: used for creation of new project since: should return the project directory.
since: The method should not be also used to provide a GUI to open subprojects. since: The org.netbeans.spi.project.ui.support.CommonProjectActions.openSubprojectsAction since: should be used since: instead. since:
|
openProjects | public Future<Project[]> openProjects()(Code) | | Method to track progress of projects opening and closing. As the
opening of a project may take long time, and as there can be multiple
projects open at once, it may be necessary to be notified that the process
of open project list modification started or that it has
finished. This method provides a future that can do that.
To find out that the list of open projects is currently modified use:
assert openProjects().isDone() == false;
To wait for the opening/closing to be finished and then obtain the result
use:
Project[] current = openProjects().get();
This result is different that a plain call to
OpenProjects.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!).
future to track computation of open projects since: 1.27 |
removePropertyChangeListener | public void removePropertyChangeListener(PropertyChangeListener listener)(Code) | | Removes a listener.
Parameters: listener - a listener to remove |
setMainProject | public void setMainProject(Project project) throws IllegalArgumentException(Code) | | Sets the 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.
Parameters: project - project to set as main project (must be open), ornull to set no project as main. throws: IllegalArgumentException - if the project is not opened. since: 1.11 |
|
|