Community
Participate
Working Groups
When one needs to add more than one filter after every request a refresh command is issued which is not desired an API-Function where the user could control whether the refresh is called or not would be a great performance improvement.
Created attachment 46567 [details] Patch to add new API-Function This patch adds the possiblity to control whether the viewer is automatically refresh or not
Why not addFilters(ViewerFilter[]) ?
Even better I thought about that after having submitted the code. Will prepare a patch. (In reply to comment #2) > Why not addFilters(ViewerFilter[]) ? >
Created attachment 46960 [details] Adding API function to removeFilters/addFilters This implements the same behaviour than before but using removeFilters/addFilters instead of flags
Your patch changes the behaviour of the existing remove method - see this comment in the original code: // Note: can't use List.remove(Object). Use identity comparison // instead. I believe addFilters()/removeFilters() would have to use identity comparisons as well.
Created attachment 47134 [details] Revised patch Hopefully this does create the same problem one should read and think about the comments before code ;-)
Created attachment 49274 [details] Added new replace method Boris it would be nice if this patch could be accepted it's only a very small change but it is really vital to performance and user experience.
Wouldn't it be simpler (and less new API) to just have a method void setFilters(ViewerFilter[] filters) ?
Created attachment 49847 [details] The implementation You are completely right Boris.
I would feel much better about putting this in if we had some test cases. Tom, how can we help you with writing some JUnit tests?
Created attachment 49855 [details] NLP fix and Tests You are right Boris and I found a bug in my implementation when there haven't been any filters. All tests pass beside the Virtual ones and I can't grasp why I think the implementation is now correct but maybe. I can't really grasp what the problem is maybe it's something todo that the item count is not decreased approrpiately?
Filtering and sorting is not supported for the virtual case (when using an ILazyContentProvider). You will have to override the new test methods in VirtualLazy*ViewerTest to do nothing, or only add the new methods to concrete subclasses like Table/TreeViewerTest. This is not very clean, so if you have a better idea how to structure the tests please let me know.
Created attachment 49863 [details] Fixed test-problems with virtual Oh. I see I think leaving the testFilter and testSetFilters next to each other is the better way.
Sorry - one more: Collections.addAll(this.filters, filters); is @since 1.5, which we cannot use. JFace runs on CDC-1.0/Foundation-1.0 and J2SE-1.3 which means we can only use the subset of J2SE-1.3 supported by CDC-1.0/Foundation-1.0. I suggest that you install a 1.3 JRE and make it known to Eclipse. PDE will then pick this up (see the Execution Environment section in the PDE editor) and set the classpath accordingly so that you cannot use 1.4 or 1.5 API for JFace anymore.
Created attachment 49867 [details] 1.3 support ;-)
(In reply to comment #14) > I suggest that you install a 1.3 JRE and make it known to Eclipse. PDE will > then pick this up (see the Execution Environment section in the PDE editor) and > set the classpath accordingly so that you cannot use 1.4 or 1.5 API for JFace > anymore. > Is 1.3.1-18 ok?
(In reply to comment #16) > Is 1.3.1-18 ok? Yes. I assume that just like Eclipse, Sun does not change API in maintenance releases.
(In reply to comment #17) > (In reply to comment #16) > > Is 1.3.1-18 ok? > > Yes. I assume that just like Eclipse, Sun does not change API in maintenance > releases. > ok, guess what jface doesn't compile any more because in DialogSettings there are classes used that don't exist in 1.3 like javax.xml.* and org.w3c.* do I need to add something like xerces to my class path then?
Created attachment 49893 [details] updated patch I updated the patch once again: shortened Javadoc, setFilters() now does not take null, simplified the code in setFilters(), added contribution notices. Released >20060911.
Released >20060911. Thanks for your work, Tom!