MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / actionPerformed

Method actionPerformed

src/main/java/core/packetproxy/gui/GUIData.java:85–101  ·  view source on GitHub ↗
(ActionEvent actionEvent)

Source from the content-addressed store, hash-verified

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");

Callers 1

fireActionEventMethod · 0.45

Calls 15

getInstanceMethod · 0.95
getInstanceMethod · 0.95
createMethod · 0.95
getMethodMethod · 0.95
getURLMethod · 0.95
getServerPortMethod · 0.95
getUseSSLMethod · 0.95
getBodyMethod · 0.95
getInstanceMethod · 0.95
getOneShotPacketMethod · 0.95
setResendMethod · 0.95
getInstanceMethod · 0.95

Tested by

no test coverage detected