|
|||||||||||
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 |
getMainProject()
Retrieves the current main project set in the IDE. |
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. |
void |
setMainProject(Project project)
Sets the main project. |
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 Project getMainProject()
Warning: the set of usecases that require invoking this method is
limited. MainProjectSensitiveActions
should
be used in favour of this method if possible. In particular, this method should not
be used to let user choose if an action should be run over main or current project.
public void setMainProject(Project project) throws IllegalArgumentException
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 set project created by the New Project Wizard as main.
project
- project to set as main project (must be open), or
null
to set no project as main.
IllegalArgumentException
- if the project is not opened.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 |