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.
[dev oct 25] There are a number of problems now in the Explorer as a result of the recent TreeView patch, all of which are basically the same bug: control sequences of various sorts, which are supposed to be treated as key bindings, are swallowed and used to search for nodes. This applies to *a lot* of common bindings, e.g. Ctrl-C for Copy no longer copies; it displays a search box with a square "undisplayable character" entry (I guess it is trying to display "\u0003"). I see: public void keyPressed(KeyEvent e) { char c = e.getKeyChar(); if (Character.isJavaIdentifierPart(c)|| (c == File.separatorChar)) { // ... Presumably this needs to check also that there were no modifier keys pressed! Non-alphanumeric keystrokes such as S-F10 (popup) continue to work. I also noticed that after successfully finding a node, if you do not press Escape first, pressing Enter expands the tree node rather than running its default action. E.g. type letters until a Java source is selected, then press Enter: it is expanded, showing the parse result. If you press Escape first, the source is opened in the editor. I would expect this to happen without pressing Escape, too.
I've refactored the search handling code a little bit, added some functionality and fixed this bug. I'll attach the new patch. Here are the changes: 1) I followed David Simonkek's suggestion (see bug #28244) and reduced the number of instantiated anonymous classes by combining more listeners in a single class (SearchFieldListener) 2) Up and down arrow keys can now be used to navigate through matching nodes (this means that if you have two nodes called for example 'openide' and the textfield contains 'open' you can use the arrow keys to select the desired node) 3) There should be no problems now with the tree key bindings. However I've tested only the common combinations (cut, copy, paste, delete). 4) Pressing Enter now runs the default action. It also expands the node, but this can be easily switched off.
Created attachment 7787 [details] the new patch
The problem with the modifiers was fixed at 25 Oct, I leave it open since I assure all consequences.
Jiri, could you have a look over the new patch attached here? It contains your fixes (the delete key and the modifiers), but adds some nice (I hope so :)) enhancements.
I look at the source code of the patch and it seems ok to me, enhs are good! Just one minor comment - after talks with colleagues, we came to conclusion that basically any printable character should trigger search field open, because explorer as part of netbeans platform can be used in environments where directory names can contain virtually any printable characters. However I didn't find better method then isJavaIdentifierPart, completed with '/' and perhaps some other characters permissible in directory names.
Re. "any printable character" - maybe !Character.isISOControl(c) would work. (After ensuring that there are no modifier keys pressed, and that the keystroke maps to a character, not only a keycap.) isJavaIdentifierPart plus '/' includes a lot of Unicode, but excludes many characters that would commonly be found in node names: '.', '-', and so on.
fixed, isICOControl is used. added Leon' patch and add completion to the longest possibled prefix by TAB
verified