Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » GridTreeViewer: selection changed listener and viewer.setSelection
GridTreeViewer: selection changed listener and viewer.setSelection [message #991290] Tue, 18 December 2012 06:40 Go to next message
Eclipse UserFriend
Hi guys
I have a table (GridTreeViewer) with a selection changed listener doing some stuff.
Then I have another table below, from which I need to set the selection on the table above at a certain point.
The problem is, when I do viewer.setSelection(mySelection) I do get redirected into the selection changed listener (as I want) but there:
- the selection inside the event is null (I assume it is so, because the user didn't actually click on the table...)
- viewer.getSelection is also null (Why? I just set it..)

Are viewer.setSelection and SelectionChangedListener not supposed to work together? If so, what is the right way to do this? Is it necessary to use the selection provider service?
Re: GridTreeViewer: selection changed listener and viewer.setSelection [message #991292 is a reply to message #991290] Tue, 18 December 2012 06:45 Go to previous message
Eclipse UserFriend
No - the reason is not that you manually executed the setSelection. I
think the problem is that you are trying to set a selection on a value
that can not be selected.

BTW: This is not an e4 question but is better asked in jface or nebula
newsgroup

Tom

Am 18.12.12 12:40, schrieb Laura V:
> Hi guys
> I have a table (GridTreeViewer) with a selection changed listener doing
> some stuff.
> Then I have another table below, from which I need to set the selection
> on the table above at a certain point.
> The problem is, when I do viewer.setSelection(mySelection) I do get
> redirected into the selection changed listener (as I want) but there:
> - the selection inside the event is null (I assume it is so, because the
> user didn't actually click on the table...)
> - viewer.getSelection is also null (Why? I just set it..)
>
> Are viewer.setSelection and SelectionChangedListener not supposed to
> work together? If so, what is the right way to do this? Is it necessary
> to use the selection provider service?
Previous Topic:Issues with Kepler M4 and E4 Tools
Next Topic:Tab placement always remove most used window
Goto Forum:
  


Current Time: Wed Jul 23 09:35:31 EDT 2025

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

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

Back to the top