feat(gui):improve search and usage dialog#2383
Conversation
|
Well, it is sad that this PR don't get any suggestions or comments. Anyway, I have some thoughts:
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. |
|
@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. |
|
It looks very nice! I think this was a very much needed task to be performed, I'm glad it's already being worked on. I have one suggestion. It would be nice if the nesting in packages/classes could be disabled, and have everything shown in a single node like it's implemented right now. In most cases this will never be desired, but sometimes when looking at strings or some common code, it's appreciated to see it next to each others to spot differences quickly. Thanks! |
|
@skylot I decided to see how search is implemented, find usages in netbeans ide. I think something similar can be done here? We can even seen code how everything) There everything is not in a separate dialog but at the bottom of the screen, which in principle can be tried to be implemented here, also with tabs(?). I also thought to take the editor from there, it is more productive, but it implemet very hard. |
|
@MrIkso I see, so results are in tree with preview panel, and this looks very similar to implementation in this PR 🙂
Sure, there is already an issue for start using dockable framework (#2237), but all docking frameworks are very old and abandoned, only active is a ModernDocking, we might use it once it became stable enough. |
| * @return the pattern | ||
| */ | ||
| public static Pattern generatePattern(String exp, boolean caseSensitive, boolean wholeWord, boolean useRegexp) { | ||
| String word = exp; |
There was a problem hiding this comment.
I think it's probably better to use StringBuilder here until you're done processing the string
| if (!useRegexp) { | ||
| word = word.replace("\\E", "\\E\\\\E\\Q"); | ||
| word = "\\Q" + word + "\\E"; | ||
| if (wholeWord && exp.matches("\\b.*\\b")) { |
There was a problem hiding this comment.
Why is the second condition needed here? exp.matches("\\b.*\\b")? Isn't just the wholeWord flag enough?
| String word = exp; | ||
| if (word != null && !word.isEmpty()) { | ||
| if (!useRegexp) { | ||
| word = word.replace("\\E", "\\E\\\\E\\Q"); |
There was a problem hiding this comment.
Could you please add a comment explaining why this is necessary?
|
@MrIkso Thanks for working on this. I was wondering why there was no 'Whole word' search feature so I went ahead and implemented it myself but your version seems better. Really looking forward to it. |





This PR improves Search and Usage dialogs. Releated to #2009 , #2373, #1130
Main features:
Removed
Limitations
Preview
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).