|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.api.project.ui.OpenProjects
List of projects open in the GUI.
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 ProjectSensitiveActions
(or 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.
Field Summary | |
static String |
PROPERTY_OPEN_PROJECTS
Property representing open projects. |
Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to changes in the set of open projects. |
void |
close(Project[] projects)
Closes given projects. |
static OpenProjects |
getDefault()
Get the default singleton instance of this class. |
Project[] |
getOpenProjects()
Gets a list of currently open projects. |
void |
open(Project[] projects,
boolean openSubprojects)
Opens given projects. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PROPERTY_OPEN_PROJECTS
getOpenProjects()
,
Constant Field ValuesMethod Detail |
public static OpenProjects getDefault()
public Project[] getOpenProjects()
public void open(Project[] projects, boolean openSubprojects)
ProjectManager.mutex()
in the write mode.
projects
- to be opened. In the case when some of the projects are already opened
these projects are not opened again. If the projects contain duplicates, the duplicated
projects are opened just once.openSubprojects
- if true also subprojects are opened.
This method is designed for use by logical view's Libraries Node to open one or more of dependent
projects. This method can be used also by other project GUI components which need to open certain
project(s), eg. code generation wizards.
The method should not be used for opening newly created project, insted the
WizardDescriptor.InstantiatingIterator.instantiate()
used for creation of new project
should return the project directory.
The method should not be also used to provide a GUI to open subprojects.
The CommonProjectActions.openSubprojectsAction()
should be used
instead.
public void close(Project[] projects)
ProjectManager.mutex()
in the write mode.
projects
- to be closed. The non opened project contained in the projects array are ignored.public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- a listener to addPROPERTY_OPEN_PROJECTS
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- a listener to remove
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |