dialog.setFilterExtensions( fileExt ); } try { String filename = dialog.open( );  if ( filename != null ) { File file = new File( filename ); if(!(file.isFile( ) && file.exists( ))) { ExceptionHandler.openErrorMessageBox( Messages.getString( "HyperlinkBuilder.FileNameError.Title" ), Messages.getString( "HyperlinkBuilder.FileNameError.Message" ) ); return; }  filename = file.toURL( ).toString( );   if ( needFilter && checkExtensions( fileExt, filename ) == false ) { ExceptionHandler.openErrorMessageBox( Messages.getString( "HyperlinkBuilder.FileNameError.Title" ), Messages.getString( "HyperlinkBuilder.FileNameError.Message" ) ); return; }  if ( needFilter ) { filename = URIUtil.getRelativePath( getBasePath( ), filename ); } filename = new Path( filename ).toString( ); if ( needQuote ) { filename = "\"" + filename + "\""; } text.setText( filename ); }
text.setText( builder.getResult( ) );
			public void widgetSelected( SelectionEvent e )			{				FileDialog dialog = new FileDialog( UIUtil.getDefaultShell( ) );				if ( needFilter )				{					dialog.setFilterExtensions( fileExt );				}				try				{					String filename = dialog.open( );					if ( filename != null )					{						File file = new File( filename );						if(!(file.isFile( ) && file.exists( )))						{							ExceptionHandler.openErrorMessageBox( Messages.getString( "HyperlinkBuilder.FileNameError.Title" ),									Messages.getString( "HyperlinkBuilder.FileNameError.Message" ) );							return;						}												filename = file.toURL( ).toString( );												// should check extensions in Linux enviroment						if ( needFilter && checkExtensions( fileExt, filename ) == false )						{							ExceptionHandler.openErrorMessageBox( Messages.getString( "HyperlinkBuilder.FileNameError.Title" ),									Messages.getString( "HyperlinkBuilder.FileNameError.Message" ) );							return;						}												if ( needFilter )						{							filename = URIUtil.getRelativePath( getBasePath( ),									filename );						}						filename = new Path( filename ).toString( );						if ( needQuote )						{							filename = "\"" + filename + "\""; //$NON-NLS-1$ //$NON-NLS-2$						}						text.setText( filename );					}					updateButtons( );				}				catch ( Exception ex )				{					ExceptionHandler.handle( ex );				}			}