public void addOfflineProject(final IProject project){
  Check.notNull(project,"project");
  log.debug(MessageFormat.format("Adding project {0} for offline repository",project.getName()));
  waitForManagerStartup();
  try {
    project.setPersistentProperty(REPOSITORY_STATUS_KEY,REPOSITORY_STATUS_OFFLINE_VALUE);
  }
 catch (  final CoreException e) {
    log.error(MessageFormat.format("Could not set offline status for project {0}",project.getName()),e);
  }
synchronized (projectDataLock) {
    ProjectRepositoryData projectData=projectDataMap.get(project);
    if (projectData != null) {
      log.error(MessageFormat.format("Project Manager already contains project {0} (when adding)",project.getName()));
      CodeMarkerDispatch.dispatch(FINISH_PROJECT_ADDITION);
      return;
    }
    projectData=new ProjectRepositoryData();
    projectData.setStatus(ProjectRepositoryStatus.OFFLINE);
    projectDataMap.put(project,projectData);
  }
  log.info(MessageFormat.format("Project {0} is now managed by TFS (but offline)",project.getName()));
  CodeMarkerDispatch.dispatch(FINISH_PROJECT_ADDITION);
}

public void addOfflineProject ( final IProject project ) { Check . notNull ( project , "project" ) ; log . debug ( MessageFormat . format ( "Adding project {0} for offline repository" , project . getName ( ) ) ) ; waitForManagerStartup ( ) ; try { project . setPersistentProperty ( REPOSITORY_STATUS_KEY , REPOSITORY_STATUS_OFFLINE_VALUE ) ; } catch ( final CoreException e ) { log . error ( MessageFormat . format ( "Could not set offline status for project {0}" , project . getName ( ) ) , e ) ; } synchronized ( projectDataLock ) { ProjectRepositoryData projectData = projectDataMap . get ( project ) ; if ( projectData != null ) { log . error ( MessageFormat . format ( "Project Manager already contains project {0} (when adding)" , project . getName ( ) ) ) ; CodeMarkerDispatch . dispatch ( FINISH_PROJECT_ADDITION ) ; return ; } projectData = new ProjectRepositoryData ( ) ; projectData . setStatus ( ProjectRepositoryStatus . OFFLINE ) ; projectDataMap . put ( project , projectData ) ; } log . info ( MessageFormat . format ( "Project {0} is now managed by TFS (but offline)" , project . getName ( ) ) ) ; CodeMarkerDispatch . dispatch ( FINISH_PROJECT_ADDITION ) ; }
adds this project to the project manager , but keeps the project offline . this should only be done when new projects are added to the repository system - ie , through automatic project detection and connection .
