Skip to content

Commit

Permalink
pass callbacks instead of helpers to editor instance
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed May 9, 2016
1 parent a40d3d4 commit c22822e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 4 additions & 2 deletions src/burp/JsonJTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down

0 comments on commit c22822e

Please sign in to comment.