int numberOfFilesNotFound = 0;
StringBuffer notFound = new StringBuffer();
IWorkbenchPage page = window.getActivePage();
for ( String name : names )
{
IFileStore fileStore = EFS.getLocalFileSystem().getStore( new Path( filterPath ) ).getChild( name );
IFileInfo fetchInfo = fileStore.fetchInfo();
if ( !fetchInfo.isDirectory() && fetchInfo.exists() )
{
try
{
IDE.openEditorOnFileStore( page, fileStore );
}
catch ( PartInitException e )
{
MessageDialog.openError( window.getShell(), Messages.getString( "OpenFileAction.Error" ), e //$NON-NLS-1$
.getMessage() );
}
}
else
{
if ( ++numberOfFilesNotFound > 1 )
{
notFound.append( '\n' );
}
notFound.append( fileStore.getName() );
}
}
if ( numberOfFilesNotFound > 0 )
{