All I would like to do is to add double-click-to-sort at a JFace TreeViewer column. I could find the question asked in Eclipse forum since May 2010 but no response so far.
So far I have tried:
column.addListener(SWT.MouseDoubleClick, listener); // Not working, listener never called
treeViewer.addDoubleClickListen开发者_运维问答er(new IDoubleClickListener(); // Work in the item, not column header
Am I missing something?
Any advice is apprecated.
Hei
The last time I checked this was still not possible with SWT 3.7. Like the documentation states, TreeColumns
and TableColumns
only send Move
, Resize
and Selection
events. Plus, column headers can now (well, since 3.5 or so) display the control's context menu. But there's nothing to detect a double click on a column header.
Since you seem to need this for sorting, does it have to be a double click? The Selection
event (i.e. single click) of a column is the common way to do that.
精彩评论