private void handleAntScriptBrowseButtonPressed ( ) { FileDialog dialog = new FileDialog ( getContainer ( ) . getShell ( ) , SWT . SAVE ) ; dialog . setFilterExtensions ( new String [ ] { "*." + ANTSCRIPT_EXTENSION } ) ; //$NON-NLS-1$ String currentSourceString = getAntScriptValue ( ) ; int lastSeparatorIndex = currentSourceString . lastIndexOf ( File . separator ) ; if ( lastSeparatorIndex != - 1 ) { dialog . setFilterPath ( currentSourceString . substring ( 0 , lastSeparatorIndex ) ) ; dialog . setFileName ( currentSourceString . substring ( lastSeparatorIndex + 1 , currentSourceString . length ( ) ) ) ; } String selectedFileName = dialog . open ( ) ; if ( selectedFileName != null ) fAntScriptNamesCombo . setText ( selectedFileName ) ; }
Open an appropriate ant script browser so that the user can specify a source to import from