{
returnData = currentData;
}
else if ( buttonId == SAVE_BUTTON_ID )
{
FileDialog fileDialog = new FileDialog( getShell(), SWT.SAVE );
fileDialog.setText( Messages.getString( "HexDialog.SaveData" ) ); //$NON-NLS-1$
// fileDialog.setFilterExtensions(new String[]{"*.jpg"});
String returnedFileName = fileDialog.open();
if ( returnedFileName != null )
{
try
{
File file = new File( returnedFileName );
FileUtils.writeByteArrayToFile( file, currentData );
}
catch ( IOException e )
{
ConnectionUIPlugin.getDefault().getExceptionHandler().handleException(
new Status( IStatus.ERROR, BrowserCommonConstants.PLUGIN_ID, IStatus.ERROR, Messages
.getString( "HexDialog.CantWriteToFile" ), e ) ); //$NON-NLS-1$
}
}
}
else if ( buttonId == LOAD_BUTTON_ID )
{
FileDialog fileDialog = new FileDialog( getShell(), SWT.OPEN );
fileDialog.setText( Messages.getString( "HexDialog.LoadData" ) ); //$NON-NLS-1$
String returnedFileName = fileDialog.open();
if ( returnedFileName != null )
{
try
{
File file = new File( returnedFileName );