TableTree weirdness and ICursor [message #78761] |
Tue, 22 July 2003 08:46 |
Eclipse User |
|
|
|
I've read the numerous previous posts on TableTree's and ICursor, and the
JavaDoc page in the Eclipse help. I just want a TableTree where I can
select cells and see what the contents is (from the model). However, when I
use ICursor.getData(), it always returns null. In addition, the cursor
selecting in the table is 'sticky', and if the table is changed while a
cursor is in place it doesn't redraw, leaving 'trails'. It doesn't look
great. My code is attached below:-
------------------------
final TableCursor cursor = new TableCursor(parent.getTable(), SWT.NONE);
cursor.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
parent.getTable().setSelection(new TableItem[] {cursor.getRow()});
}
});
cursor.addMouseListener(new MouseListener() {
public void mouseDown(MouseEvent event) {}
public void mouseUp(MouseEvent event) {}
public void mouseDoubleClick(MouseEvent event) {
Object selCell = cursor.getData();
if (selCell != null) {
System.err.println("not null");
}
}
});
------------------------
Thanks for any help!
jon
|
|
|
Powered by
FUDForum. Page generated in 0.05142 seconds