Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Quick find" for an SWT Table

I have a table that displays the output from a database, this can often be up to or over 10,000 rows. I'm looking to implement a 'quick find' function that will allow the user to easily scroll to a row with the value for which they search.

The idea is for this to be very similar to Chrome or Firefox's quick find. So:

  1. User hits 'CTRL+F'
  2. A box pops up:
  3. quick find example
  4. The user can then quickly skim through the table pushing / or /\ to each matching value

My question is, does such a table already exist? I have looked at NatTable and XViewer but they both seem like rather large additions for a relatively minor change.

Another library I've looked at that is close to fitting the billl is Lucene TableSearcher unfortunately this is designed for filtering rather than highlighting. However it may be an avenue worth investigating.

like image 405
Andy Smith Avatar asked Oct 24 '22 20:10

Andy Smith


1 Answers

It's not quite the same, but JFace does have support for filtering views. You type in a text box and view contents shrink to what matches the filter. It's basically another way to present search/find functionality to the user.

You can see this in action in Eclipse Preferences (the filter text field about the navigation tree in the dialog). See org.eclipse.ui.dialogs.FilteredTree class. I don't believe there is a FilteredTable or equivalent, but underlying facilities are pretty generic, so it shouldn't take much work to put one together. Take a look at FilteredTree source and go from there.

like image 94
Konstantin Komissarchik Avatar answered Oct 27 '22 09:10

Konstantin Komissarchik