(ActionEvent actionEvent)
| 83 | copy_url_body_button.addActionListener(new ActionListener() { |
| 84 | |
| 85 | @Override |
| 86 | public void actionPerformed(ActionEvent actionEvent) { |
| 87 | try { |
| 88 | |
| 89 | int id = GUIHistory.getInstance().getSelectedPacketId(); |
| 90 | Packet packet = Packets.getInstance().query(id); |
| 91 | Http http = Http.create(tabs.getRaw().getData()); |
| 92 | String copyData = http.getMethod() + "\t" + http.getURL(packet.getServerPort(), packet.getUseSSL()) |
| 93 | + "\t" + new String(http.getBody(), "UTF-8"); |
| 94 | Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); |
| 95 | StringSelection selection = new StringSelection(copyData); |
| 96 | clipboard.setContents(selection, selection); |
| 97 | } catch (Exception e1) { |
| 98 | |
| 99 | errWithStackTrace(e1); |
| 100 | } |
| 101 | } |
| 102 | }); |
| 103 | |
| 104 | copy_body_button = new JButton("copy Body"); |
no test coverage detected