zap-extensions
zap-extensions copied to clipboard
[WIP] automation: keep job selected when moved
Fixed it by firing only the changed index nodes instead of the complete tree structure. After debugging, I found out that firing the complete tree also invokes the clearSelection of the selection model. By only firing a change for what is changed, the issue is resolved.
Please, update the changelog.
sorry, this is my first commit to this project, how and where do i update the changelog?
No problem at all - the changelog for this add-on is https://github.com/zaproxy/zap-extensions/blob/main/addOns/automation/CHANGELOG.md - you can add your fix to the Unreleased / Fixed section at the top.
Thanks for getting involved!
This does not work correctly when the jobs being moved have tests (nodes are left behind).
FYI both of the spiders have test nodes added by default, and you can add more nodes via the buttons.
This does not work correctly when the jobs being moved have tests (nodes are left behind).
I see, it fails after a new test has been added. Well tested!
I am a bit stuck here, maybe someone has an idea? I have tried a lot of things, but what should work according to me, is the following:
for (int j = 0; j < jobNode.getChildCount(); j++) {
DefaultMutableTreeNode testNode = (DefaultMutableTreeNode) jobNode.getChildAt(j);
this.fireTreeNodesChanged(this, this.getPathToRoot(jobNode), new int[] {j}, new Object[] {testNode});
}
However, the child nodes remain at the same location in the GUI when the job node is expanded. When the job node is collapsed, everything works fine (also without firing a node change for the children).
Yeah, I would have thought that should work as well, but I couldnt even get this far :/