Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gui):improve search and usage dialog #2383

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MrIkso
Copy link
Contributor

@MrIkso MrIkso commented Dec 27, 2024

This PR improves Search and Usage dialogs. Releated to #2009 , #2373, #1130

Main features:

  1. Added Whole Word find option
  2. Highlights text for found Classes/Methods/Filelds
  3. Tree structure for code/comment/resource results

Removed

  1. Open button - unuseless feature for curently view
  2. Sort button - results sorted by name defaults

Limitations

  1. Curently search available only one selected option
  2. When Method/Field name used highligt type not formatted html
Preview
Old New
Class Search Old_Search_Class_2024-12-27_02-14 Search_Class_2024-12-27_02-14
Methods Search Old_Search_Method_2024-12-27_02-14 Search_Method_2024-12-27_02-14
Field Search Old_Search_Field_2024-12-27_02-14 Search_Fileld_2024-12-27_02-14
Code Search Old_Search_Code_2024-12-27_02-14 Search_Code_2024-12-27_02-14
Resource Search Old_Sesrch_Res_2024-12-27_02-57 Search_Ressource1_2024-12-27_02-14 Search_Ressource2_2024-12-27_02-14
Usage Old_Usage_2024-12-27_02-50 Usage_2024-12-27_02-50

P.S maybe there will be more ideas how to make the appearance of the search results the best, maybe combine the table and the tree (TreeTable).

@skylot skylot added enhancement GUI Issues in jadx-gui module discussion labels Jan 15, 2025
@skylot
Copy link
Owner

skylot commented Jan 15, 2025

Well, it is sad that this PR don't get any suggestions or comments.

Anyway, I have some thoughts:
At first, we will need a tree representation in usage dialog to implement references window (#1368). That is an improvement of current usage dialog with addition of all type of references like class hierarchy, method overrides, etc. and not only usage. For this, collapsible sections are the good approach, so the tree looks like the best component.
Although in search, code preview looks better in a table component in a separate column, because obfuscated code have short names so classes/methods names became useless and tree pointless.
So, as suggested by @MrIkso, TreeTable component will be a nice approach to combine above requirements and allow using various representation as needed.
Some implementation details:

  • create a customizable tree table component which allows inserting simple text nodes (needed for references window)
  • in code search add a switch to change representation: tree or table (should change a 'model' for new component)
  • use new component in usage dialog with a single Usage top level label (others will be added later)

Such approach will allow using single component in all places to represent jadx nodes in various ways.

@MrIkso this looks like a big task, so you may change this PR, or I can merge it into a new branch and implement these myself or with your help if you want to.

@MrIkso MrIkso marked this pull request as ready for review January 15, 2025 19:14
@MrIkso
Copy link
Contributor Author

MrIkso commented Jan 15, 2025

@skylot yeah ThreeTable it's best variant. I did something like this once, it's a bit complicated but doable. My current implementation has one problem, if the string found is long, it window freezes. Otherwise everything seems to be working.
Upd.. info about TreeTable
https://www.hameister.org/JavaSwingTreeTable.html
https://www.comp.nus.edu.sg/~cs3283/ftp/Java/swingConnect/tech_topics/tables-trees/tables-trees.html
https://github.com/nishihatapalmer/TreeTable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement GUI Issues in jadx-gui module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants