private Boolean shouldConnect(final IProject project){
  Check.notNull(project,"project");
  if (!project.isOpen()) {
    log.debug(MessageFormat.format("Ignoring closed project {0}",project.getName()));
    return null;
  }
  String providerName;
  try {
    providerName=project.getPersistentProperty(TeamUtils.PROVIDER_PROP_KEY);
  }
 catch (  final CoreException e) {
    log.warn(MessageFormat.format("Could not query repository manager for project {0} (when determining connection viability)",project.getName()),e);
    return null;
  }
  if (providerName == null || !providerName.equals(TFSRepositoryProvider.PROVIDER_ID)) {
    return null;
  }
  String repositoryStatus=null;
  try {
    repositoryStatus=project.getPersistentProperty(REPOSITORY_STATUS_KEY);
  }
 catch (  final CoreException e) {
    log.warn(MessageFormat.format("Repository status could not be determined for project {0} (when determining connection viability)",project.getName()),e);
  }
  if (REPOSITORY_STATUS_OFFLINE_VALUE.equals(repositoryStatus)) {
    return Boolean.FALSE;
  }
  return Boolean.TRUE;
}

private Boolean shouldConnect ( final IProject project ) { Check . notNull ( project , "project" ) ; if ( ! project . isOpen ( ) ) { log . debug ( MessageFormat . format ( "Ignoring closed project {0}" , project . getName ( ) ) ) ; return null ; } String providerName ; try { providerName = project . getPersistentProperty ( TeamUtils . PROVIDER_PROP_KEY ) ; } catch ( final CoreException e ) { log . warn ( MessageFormat . format ( "Could not query repository manager for project {0} (when determining connection viability)" , project . getName ( ) ) , e ) ; return null ; } if ( providerName == null || ! providerName . equals ( TFSRepositoryProvider . PROVIDER_ID ) ) { return null ; } String repositoryStatus = null ; try { repositoryStatus = project . getPersistentProperty ( REPOSITORY_STATUS_KEY ) ; } catch ( final CoreException e ) { log . warn ( MessageFormat . format ( "Repository status could not be determined for project {0} (when determining connection viability)" , project . getName ( ) ) , e ) ; } if ( REPOSITORY_STATUS_OFFLINE_VALUE . equals ( repositoryStatus ) ) { return Boolean . FALSE ; } return Boolean . TRUE ; }
determines whether we should connect this project . returns true if we should connect , false if the project should be offline , or null if we should ignore this project altogether .
