Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:40 Go to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
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 11:45 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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: Thu Apr 25 12:48:54 GMT 2024

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

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

Back to the top