Version: 3.2.1 Update
This commit is contained in:
@@ -474,6 +474,13 @@ public class MessageTableModel extends AbstractTableModel {
|
|||||||
@Override
|
@Override
|
||||||
public void changeSelection(int row, int col, boolean toggle, boolean extend) {
|
public void changeSelection(int row, int col, boolean toggle, boolean extend) {
|
||||||
super.changeSelection(row, col, toggle, extend);
|
super.changeSelection(row, col, toggle, extend);
|
||||||
|
if (currentWorker != null && !currentWorker.isDone()) {
|
||||||
|
currentWorker.cancel(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentWorker = new SwingWorker<>() {
|
||||||
|
@Override
|
||||||
|
protected Void doInBackground() {
|
||||||
int selectedIndex = convertRowIndexToModel(row);
|
int selectedIndex = convertRowIndexToModel(row);
|
||||||
if (lastSelectedIndex != selectedIndex) {
|
if (lastSelectedIndex != selectedIndex) {
|
||||||
lastSelectedIndex = selectedIndex;
|
lastSelectedIndex = selectedIndex;
|
||||||
@@ -481,41 +488,25 @@ public class MessageTableModel extends AbstractTableModel {
|
|||||||
|
|
||||||
requestEditor.setRequest(HttpRequest.httpRequest("Loading..."));
|
requestEditor.setRequest(HttpRequest.httpRequest("Loading..."));
|
||||||
responseEditor.setResponse(HttpResponse.httpResponse("Loading..."));
|
responseEditor.setResponse(HttpResponse.httpResponse("Loading..."));
|
||||||
|
|
||||||
if (currentWorker != null && !currentWorker.isDone()) {
|
|
||||||
currentWorker.cancel(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
currentWorker = new SwingWorker<>() {
|
|
||||||
@Override
|
|
||||||
protected ByteArray[] doInBackground() {
|
|
||||||
HttpRequestResponse httpRequestResponse = messageEntry.getRequestResponse();
|
HttpRequestResponse httpRequestResponse = messageEntry.getRequestResponse();
|
||||||
|
|
||||||
ByteArray requestByte = messageEntry.getRequestResponse().request().toByteArray();
|
ByteArray requestByte = httpRequestResponse.request().toByteArray();
|
||||||
ByteArray responseByte = messageEntry.getRequestResponse().response().toByteArray();
|
ByteArray responseByte = httpRequestResponse.response().toByteArray();
|
||||||
|
|
||||||
if (responseByte.length() > MAX_LENGTH) {
|
if (responseByte.length() > MAX_LENGTH) {
|
||||||
String ellipsis = "\r\n......";
|
String ellipsis = "\r\n......";
|
||||||
responseByte = responseByte.subArray(0, MAX_LENGTH).withAppended(ellipsis);
|
responseByte = responseByte.subArray(0, MAX_LENGTH).withAppended(ellipsis);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ByteArray[]{requestByte, responseByte};
|
requestEditor.setRequest(HttpRequest.httpRequest(messageEntry.getRequestResponse().httpService(), requestByte));
|
||||||
|
responseEditor.setResponse(HttpResponse.httpResponse(responseByte));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
return null;
|
||||||
protected void done() {
|
|
||||||
if (!isCancelled()) {
|
|
||||||
try {
|
|
||||||
ByteArray[] result = (ByteArray[]) get();
|
|
||||||
requestEditor.setRequest(HttpRequest.httpRequest(messageEntry.getRequestResponse().httpService(), result[0]));
|
|
||||||
responseEditor.setResponse(HttpResponse.httpResponse(result[1]));
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
currentWorker.execute();
|
currentWorker.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -191,3 +191,4 @@ public class ProjectProcessor {
|
|||||||
return requiredRootEntries.isEmpty() && hasHttpDirectoryWithFiles;
|
return requiredRootEntries.isEmpty() && hasHttpDirectoryWithFiles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user