*
* @return
*/
private Project getMainProject() {
OpenProjects open = OpenProjects.getDefault();
Project project = open.getMainProject();
//in NetBeans 7.2, we may not have a main project
//check the global selection to see if there's a project in there
if(project == null) {
project = globalProjectSelection;
}
//if their is no main project and the global selection does
//not contain a quorum project, check to see if there's only
//one project
if(project == null && open.getOpenProjects()!= null && open.getOpenProjects().length == 1) {
project = open.getOpenProjects()[0];
}
if(project != null) {
MainFileProvider localProvider =
project.getLookup().lookup(MainFileProvider.class);
if (localProvider == null) {
//either this is not a quorum project or we should return
return null;
}
}