question: public TFSRepository connectIfNecessary ( final IProject project ) { Check . notNull ( project , "project" ) ; waitForManagerStartup ( ) ; ProjectRepositoryData projectData ; synchronized ( projectDataLock ) { projectData = projectDataMap . get ( project ) ; if ( projectData == null ) { Boolean shouldConnect = shouldConnect ( project ) ; if ( shouldConnect == null ) { return null ; } projectData = new ProjectRepositoryData ( ) ; projectDataMap . put ( project , projectData ) ; projectClosedSet . remove ( project ) ; if ( shouldConnect . equals ( Boolean . FALSE ) && isAnyProjectOfStatus ( ProjectRepositoryStatus . ONLINE ) ) { shouldConnect = Boolean . TRUE ; } else if ( shouldConnect . equals ( Boolean . TRUE ) && isAnyProjectOfStatus ( ProjectRepositoryStatus . OFFLINE ) ) { shouldConnect = Boolean . FALSE ; } if ( shouldConnect == Boolean . FALSE ) { projectData . setStatus ( ProjectRepositoryStatus . OFFLINE ) ; return null ; } projectData . setStatus ( ProjectRepositoryStatus . CONNECTING ) ; } else { synchronized ( projectData ) { if ( projectData . getStatus ( ) == ProjectRepositoryStatus . INITIALIZING ) { return null ; } else if ( projectData . getStatus ( ) != ProjectRepositoryStatus . CONNECTING ) { return projectData . getRepository ( ) ; } } } } return connectInternal ( project , true , projectData ) ; }
target:  Connects the given IProject to its Team Foundation Server if and only if it is not marked offline. This method will not reconnect offline projects. This manager need not have any previous knowledge of this project. This is most useful when a project was closed and is now opened.