protected boolean isValidProjectName ( ) { final String name = this . fProjText . getText ( ) ; if ( Strings . isNullOrEmpty ( name ) ) { setErrorMessage ( Messages . MainLaunchConfigurationTab_3 ) ; return false ; } final IWorkspace workspace = ResourcesPlugin . getWorkspace ( ) ; final IStatus status = workspace . validateName ( name , IResource . PROJECT ) ; if ( status . isOK ( ) ) { final IProject project = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( name ) ; if ( ! project . exists ( ) ) { setErrorMessage ( MessageFormat . format ( Messages . MainLaunchConfigurationTab_4 , name ) ) ; return false ; } if ( ! project . isOpen ( ) ) { setErrorMessage ( MessageFormat . format ( Messages . MainLaunchConfigurationTab_5 , name ) ) ; return false ; } } else { setErrorMessage ( MessageFormat . format ( Messages . MainLaunchConfigurationTab_6 , status . getMessage ( ) ) ) ; return false ; } return true ; }
Replies if the project name is valid .