GridTreeViewer: selection changed listener and viewer.setSelection [message #991290] |
Tue, 18 December 2012 06:40  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.04543 seconds