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.

Bug 28244 - TreeView patch
Summary: TreeView patch
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: A11Y, UI
Depends on: 28311 30187
Blocks:
  Show dependency tree
 
Reported: 2002-10-24 12:23 UTC by _ leonchiver
Modified: 2008-12-23 12:53 UTC (History)
5 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
the patch file (7.34 KB, patch)
2002-10-24 12:24 UTC, _ leonchiver
Details | Diff
the applied patch (7.58 KB, patch)
2002-10-25 14:31 UTC, Jiri Rechtacek
Details | Diff
fixes the delete key bug (1.16 KB, patch)
2002-10-25 15:21 UTC, _ leonchiver
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ leonchiver 2002-10-24 12:23:50 UTC
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
Comment 1 _ leonchiver 2002-10-24 12:24:47 UTC
Created attachment 7758 [details]
the patch file
Comment 2 Jiri Rechtacek 2002-10-25 08:30:32 UTC
The patch cannot be direct used because
java.awt.Compoment.getKeyListeners is since 1.4. The listener should
be construct by different way.
Comment 3 David Simonek 2002-10-25 11:15:51 UTC
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.
Comment 4 Jiri Rechtacek 2002-10-25 14:29:03 UTC
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
Comment 5 Jiri Rechtacek 2002-10-25 14:31:55 UTC
Created attachment 7775 [details]
the applied patch
Comment 6 Jiri Rechtacek 2002-10-25 14:46:55 UTC
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
Comment 7 _ leonchiver 2002-10-25 15:20:28 UTC
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.
Comment 8 _ leonchiver 2002-10-25 15:21:21 UTC
Created attachment 7777 [details]
fixes the delete key bug
Comment 9 David Simonek 2002-10-25 15:32:28 UTC
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.
Comment 10 _ jrichard 2002-10-30 01:10:55 UTC
> - 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. :)
Comment 11 David Simonek 2002-10-30 08:28:52 UTC
CCing Tor, he will be interested for sure :-)
Comment 12 Jiri Rechtacek 2002-10-30 16:36:54 UTC
applied Leon' patch and add completion to
the longest possibled prefix by TAB.
Comment 13 David Simonek 2002-10-30 16:47:05 UTC
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.
Comment 14 Torbjorn Norbye 2002-10-30 17:15:42 UTC
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...
Comment 15 Jesse Glick 2003-01-17 14:59:12 UTC
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
Comment 16 Patrick Keegan 2003-01-20 18:12:38 UTC
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?

Comment 17 Jesse Glick 2003-01-20 19:05:12 UTC
"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.
Comment 18 Patrick Keegan 2003-01-20 22:21:23 UTC
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?
Comment 19 Jesse Glick 2003-01-20 23:05:55 UTC
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.
Comment 20 Patrick Keegan 2003-01-20 23:13:52 UTC
Never mind. I forgot that the right and left arrows control expanding 
and collapsing of folders.
Comment 21 Patrick Keegan 2004-03-04 22:48:44 UTC
old news; removing RELNOTE keyword