Is there any easy way to filter items in a SWT Table ? and to sort TableItems ?
I have not found any, and by using an internal data table to store the complete information (without filtere开发者_高级运维d out items), I have greatly increased the complexity of my program and also made it much more inefficient due to all the issues that must be taken into account to keep both tables synchronized with each other... I intend to be able to filter both by text, and by mathematical conditions for numeric fields.
I'd also like to know if there is any easy way to order items in a SWT Table, because the approach i have taken so far for ordering also makes use of an internal table which makes the code quite ugly in plenty of spots.
As Mike L. suggested, you may want to use JFace wrapper for SWT table (org.eclipse.jface.viewers.TableViewer), which gives your table more built in features. I suggest this tutorial for JFace TableViewer. Here is tutorial for sorting TableViewer.
Take a look at JFace.
精彩评论