{
if( submit.getRequest() != request )
return;
Status status = submit.getStatus();
HttpResponse response = ( HttpResponse )submit.getResponse();
if( status == Status.FINISHED || status == Status.ERROR )
{
request.setResponse( response, context );
}
if( hasClosed )
{
request.removeSubmitListener( this );
return;
}
cancelButton.setEnabled( false );
setEnabled( true );
String message = null;
String infoMessage = null;
String requestName = request.getOperation() == null ? request.getName() : request.getOperation().getInterface()
.getName()
+ "." + request.getOperation().getName() + ":" + request.getName();
if( status == Status.CANCELED )
{
message = "CANCELED";
infoMessage = "[" + requestName + "] - CANCELED";
}
else
{
if( status == Status.ERROR || response == null )
{
message = "Error getting response; " + submit.getError();
infoMessage = "Error getting response for [" + requestName + "]; " + submit.getError();
}
else
{
long attchmentsSize = 0;
if( response.getAttachments().length > 0 )
{
for( Attachment att : response.getAttachments() )
{
attchmentsSize += att.getSize();
}
}
message = "response time: " + response.getTimeTaken() + "ms ("
+ ( response.getContentLength() + attchmentsSize ) + " bytes)";
infoMessage = "Got response for [" + requestName + "] in " + response.getTimeTaken() + "ms ("
+ ( response.getContentLength() + attchmentsSize ) + " bytes)";
if( !splitButton.isEnabled() )
requestTabs.setSelectedIndex( 1 );
responseEditor.requestFocus();