This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Already posted on nbdev: Hi, I'd like to submit a patch for org.openide.explorer.view.TreeView.java. The patch adds incremental search capability to the explorer tree. Basically, you start typing with the focus in the explorer tree. Visual feedback is provided via a textfield added to the tree. The first matching node is selected. Enter or ESC dismisses the text field. I think it's a usefull feature, and it can be found in other IDE's too (IDEA, JBuilder). There are still improvements to be done (keyboard navigation through matching nodes etc.) but I wouldn't invest any more time until I know the state of this patch. Bye, Leon
Created attachment 7758 [details] the patch file
The patch cannot be direct used because java.awt.Compoment.getKeyListeners is since 1.4. The listener should be construct by different way.
I did review of the code, and I agree with changes Jiri made to the code (Jiri could you describe the changes?). Code is now IMO ready to commit to main trunk, I approve.
Hi Leon, your patch was applied. We did the minor changes there (the patch will be attached): 1. avoid the method getKeyListeners (comes from jdk1.4) 2. add min/max bounds to text field 3. remove navigator when looses focus 4. avoid keyPressListener, the navigator is displayed on keyPressed Thank you again to this good stuff. -jiri
Created attachment 7775 [details] the applied patch
Leon, there are some enhancements for navigator: 1. propagate ENTER from navigator to node in tree (it will perform the default action). If a user found the wanted node, press Enter to open node in editor. 2. press TAB completes the name of node/folder in navigator - A. at least the maximum common patch of the names or - B. the complete name of the first matched node and TAB cycles the other matched nodes. 3. a possibility to type slash as folder separator. A user could type a complete path to node. Do you think that some of them could useful? Could you look on it? Thnaks, -jiri
Thanks for including the patch. There is still a problem, the delete key brings up the text field, so you cannot delete anymore using the keyboard. The patch wich fixes this problem will be here soon. Regarding the suggested improvements, I will look into that, they sound good.
Created attachment 7777 [details] fixes the delete key bug
Great work, both. I have one comment from performance point of view: there are too many new anonymous inner classes introduced (I think 5) Each of this classes will eat up 4 Kb of memory and load time is non-zero. I think they can be combined to create one named listener implementation (MultiListener?, SearchSupportListener?) which will implement ActionListener, DocumentListener, KeyListener. Impl of actionPerformed could decide which action to perform through reading info stored in event object (at least I hope). However should be documented in javadoc that listeners are combined due to perf reasons I stated above.
> - B. the complete name of the first matched node and TAB cycles the > other matched nodes. I just want to point out that without this, we loose the functionality of quickly navigating among nodes (with the similar names) with keystrokes. IMHO, this is more important than quickly navigating to a precise name... Of course, I'd rather have the TAB key. :)
CCing Tor, he will be interested for sure :-)
applied Leon' patch and add completion to the longest possibled prefix by TAB.
Great! Impl look quite complete and useful to me now, I think that mentioned: -- 3. a possibility to type slash as folder separator. A user could type a complete path to node. -- could wait, because it's not clear how big improvement it is. Currently, with using TAB completion and expand folder on ENTER, user can easily traverse through directories.
Yes, this is interesting - thanks for adding me to the interest list David. Is there any chance this can work for all explorers? In particular, I'd like it to work for TreeTableView as well...
Patrick - this should probably go into docs, if it hasn't already. Quick summary: - works in any node tree view, e.g. Explorer; opens a popup text field - type first few letters (or other printing characters) of a node name to jump to it incrementally - press Backspace to delete letters and back up - Up/Down Arrow cycles between matches of the current prefix - Enter selects the node and runs its default action, like double-clicking, e.g. open a file - Escape leaves selection on the node but does not run the default action
A couple of questions: - I take it that this feature is only supposed to work for nodes currently displayed? - shouldn't pressing Enter with a folder node selected expand that folder? It's not working for me now. Is that a separate bug?
"I take it that this feature is only supposed to work for nodes currently displayed?" - yes. "shouldn't pressing Enter with a folder node selected expand that folder? It's not working for me now. Is that a separate bug?" - I guess so; works fine for me. E.g. I have Filesystems expanded but no individual mount expanded. I type "/s" to select the /space/src/ mount; ENTER closes the search field and expands it. "nb" selects nb_all beneath that and ENTER closes the field and expands that. Etc.
Hitting Enter after typing the first few letters of a folder name successfully opens that folder for me. The problem is if I arrow up or down to a different folder and type Enter (when the text field is not open). Then it doesn't work. Should I file this as a separate issue or reopen this one?
What you just described is entirely unrelated to this issue, and I'm not even sure it's a bug. If so, it probably occurs with or without this patch. Please file separately.
Never mind. I forgot that the right and left arrows control expanding and collapsing of folders.
old news; removing RELNOTE keyword