Quick Search Popup

The quick search popup appears when you start typing in a treeview, e.g., in BeanTreeView:

By default, the search is by prefix, e.g., above, "D" is typed and immediately "Dick" is selected, since that string starts with "D". However, you can use this statement:

beanTreeView.setUseSubstringInQuickSearch(true);

...and then the entered text is used as a substring in the search:

Above, the "r" wouldn't have matched anything by default, since there's no string that starts with that letter. However, in the substring search, it matches "Harry", since there's an "r" in that string.

After the first matching node has been found, press F3 to jump to the next matching node and Shift-F3 to jump to the previous matching node.

Finally, you can also disable the quick search popup completely, which means that the JPanel will not appear at all when you type in the tree view:

beanTreeView.setQuickSearchAllowed(false);

Related issues:

Comments:

It is a very nice built-in feature. However, in case of hundrends of nodes, i would like to filter it to get an overview instead of jumping to higlighting the nodes. If the user write "r", the user sees the nodes containing "r".

Has BeanTreeView built-in filtering feature similar to quicksearch?

Thanks.

Posted by ilhami visne on January 25, 2011 at 08:28 PM PST #

Really nice :) Do you think it would be possible to share the code?

Posted by Martin Dvoracek on August 01, 2011 at 02:52 PM PDT #

Very good post, thanks.

I have a question about the quicksearch: is it possible to make it always visible and at the top of the component, instead of at the bottom?

In other words, is it possible to customize it? How?

Thanks,

Carlos

Posted by Carlos Delgado on May 23, 2012 at 12:58 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« August 2015
SunMonTueWedThuFriSat
      
8
9
19
22
23
29
31     
Today