From c22822e89099cede21ac371865eb199dd3763678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Mon, 9 May 2016 09:22:25 +0200 Subject: [PATCH] pass callbacks instead of helpers to editor instance --- src/burp/BurpExtender.java | 6 +++--- src/burp/JsonJTree.java | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/burp/BurpExtender.java b/src/burp/BurpExtender.java index 28bc20d..b41305b 100644 --- a/src/burp/BurpExtender.java +++ b/src/burp/BurpExtender.java @@ -4,18 +4,18 @@ public class BurpExtender implements IBurpExtender, IMessageEditorTabFactory { - IExtensionHelpers helpers; + IBurpExtenderCallbacks callbacks; @Override public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) { callbacks.setExtensionName("JSON JTree"); callbacks.registerMessageEditorTabFactory(this); - this.helpers = callbacks.getHelpers(); + this.callbacks = callbacks; } @Override public IMessageEditorTab createNewInstance(IMessageEditorController controller, boolean editable) { - return new JsonJTree(helpers); + return new JsonJTree(callbacks); } } diff --git a/src/burp/JsonJTree.java b/src/burp/JsonJTree.java index ce12ed5..53f7e50 100644 --- a/src/burp/JsonJTree.java +++ b/src/burp/JsonJTree.java @@ -18,13 +18,15 @@ public class JsonJTree extends MouseAdapter implements IMessageEditorTab, Clipbo private final DefaultTreeModel model = (DefaultTreeModel)tree.getModel(); private byte[] content; private final IExtensionHelpers helpers; + private final IBurpExtenderCallbacks callbacks; private int bodyOffset; - JsonJTree(IExtensionHelpers helpers) { + JsonJTree(IBurpExtenderCallbacks callbacks) { tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addMouseListener(this); - this.helpers = helpers; + this.callbacks = callbacks; + this.helpers = callbacks.getHelpers(); } @Override public void mousePressed (MouseEvent e) { if (e.isPopupTrigger()) doPop(e); }