delayed TextComponentMatcherEditor

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

delayed TextComponentMatcherEditor

Ted Zlatanov
I put together a simple solution based on TextComponentMatcherEditor to
add a delay before refiltering.  It uses java.util.Timer and TimerTask
to accomplish this.  On large lists it makes a big difference.

I did not change the TextComponentMatcherEditor constructor
intentionally, this is just a proof of concept with a quick and dirty
implementation.  It's possible that two events will get scheduled on the
Swing EDT in this implementation if the TimerTask finishes but the EDT
task is still queued.  I didn't think that was a big deal, as in the
worst case we refilter() twice, but certainly it could be a concern.

Also I use a JXBusyLabel, which is IMO very important to the user so
they know something is happening.  Obviously this is not a good general
solution but I don't know what is in the GL context.

If delay is zero, this will work like the current TextComponentMatcherEditor.

Let me know if this is useful and if I should work on it some more.


To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

delayed.diff (6K) Download Attachment