Friday, 15 January 2010

java - getViewer().setSelection() not working with FocusCellOwnerDrawHighlighter -



java - getViewer().setSelection() not working with FocusCellOwnerDrawHighlighter -

i set focus specifc row in tableviewer.

the focus , input handing defined this:

columnviewertooltipsupport.enablefor(viewer, tooltip.no_recreate); focuscellownerdrawhighlighter fch = new focuscellownerdrawhighlighter(viewer); tableviewerfocuscellmanager focuscellmanager = new tableviewerfocuscellmanager(viewer, fch); columnviewereditoractivationstrategy actsupport = new columnviewereditoractivationstrategy(viewer) { protected boolean iseditoractivationevent(final columnviewereditoractivationevent event) { homecoming event.eventtype == columnviewereditoractivationevent.traversal || event.eventtype == columnviewereditoractivationevent.mouse_click_selection || (event.eventtype == columnviewereditoractivationevent.key_pressed && event.keycode == swt.f2) || event.eventtype == columnviewereditoractivationevent.programmatic; } }; tableviewereditor.create(viewer, actsupport, columnviewereditor.tabbing_horizontal | columnviewereditor.tabbing_move_to_row_neighbor | columnviewereditor.tabbing_vertical | columnviewereditor.keyboard_activation);

the code select row is:

getviewer().setselection(new structuredselection(parametertable.getviewer().getelementat(selection)), false);

the problem is, utilize focuscellownerdrawhighlighter, setselection no longer works, meaning no row selected.

any ideas i'm doing wrong ?

regards roger

this not solution. elaborating issue. see problem in

focuscellownerdrawhighlighter:110 line viewercell cell = row.getcell(event.index); if (focuscell == null || !cell.equals(focuscell)) { removeselectioninformation(event, cell); } else { markfocusedcell(event, cell); }

initial focus cell default top index of table. focus cell , selection cell not equal removing selection background on selected cell.

java swt eclipse-rcp jface tableviewer

No comments:

Post a Comment