Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [TableViewer] How to make selection visible when Editingsupport is set?
[TableViewer] How to make selection visible when Editingsupport is set? [message #20620] Tue, 14 July 2009 11:52
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hello everybody,
I have the following situation: a TableViewer which has a
TableEditingSupport with TextCellEditor set on every column. The
navigation with the arrow keys works great when no editor is active. If
an editor is active the tabbbing works also perfectly. In these cases
only one single cell is selected (colored in darkblue).

What I am trying to achieve:
When the view containg the described TableViewer does _not_ have the
focus (the focus is on a different "navigation" view), I want to move
the selection in the TableViewer programmatically _without_ focusing the
selected cell or the TableViewer. The focus shall stay on the navigation
view.

What I tried was:
IStructuredSelection sel = null;
sel = new StructuredSelection(elementToSelect);
tableViewer.setSelection(sel);
tableViewer.refresh(true, true);

This does in fact work. The selection is moved to the specified element,
and (if necessary) the tableViewer scrolls until the element is visible.
But unfortionately the (darkblue) coloring of the selected cell gets
lost. I guess this happens because the selection does not set the focus
and the coloring is done by the FocusCellOwnerDrawHighlighter.

Does anyone know how I can color the current selection without putting
the focus to a certain cell or the tableViewer?

Thanks very much for any hints on that problem.

Regards,
Björn
Previous Topic:ObservableCollectionTreeContentProvider duplicate TreeNode creation
Next Topic:[databinding] unable to dispose observable except from DataBindingContext validation realm
Goto Forum:
  


Current Time: Thu Apr 25 07:26:57 GMT 2024

Powered by FUDForum. Page generated in 0.02270 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top