views:

121

answers:

1

Hi, pratically I build up a tableviewer as usual, but initially it does not sort all the rows according the column defined for sorting.

The code I am using:

viewer.getTable().setSortColumn(viewer.getTable().getColumn(4));
viewer.getTable().setSortDirection(SWT.UP);

Only after clicking manually the column #4 I obtain the correct order, otherwise it follows exactly the "insert order" of the object list linked to the ViewContentProvider. Please can you help me? Tnx

A: 

In the JFace API there is a sort option.

If I understood this article correctly, it describes what you need based on that sort support.

Zoltán Ujhelyi