Does setSelection(index) on a grid invoke the selectionListener attached to it? [message #46166] |
Thu, 10 January 2008 06:17  |
Eclipse User |
|
|
|
Hello all,
I have a grid and I have added a Selection Listener to it.
I wanted to know if on executing the following line of code, will this
listener get invoked:
grid.setSelection(index).
My requirement is that, when I set the selection to a gridItem using the
above line of code, the selection listener associated with it should be
invoked.
I have tried this but the selection listener is not getting fired. How can
I invoke the listener?
Any suggestion would be appreciated.
Thanks and Regards,
Asha Subramaniam.
|
|
|
|
|
|
Re: Does setSelection(index) on a grid invoke the selectionListener attached to it? [message #587528 is a reply to message #46166] |
Thu, 10 January 2008 06:29  |
Eclipse User |
|
|
|
This is common to all SWT-Widget and I think Grid behaves like real
native ones. Setting a selection through code will never trigger an event.
In standard SWT you have to call notifyListener() your own but I don't
know if this is the same in Nebula-Grid.
Tom
Asha Subramaniam schrieb:
> Hello all,
>
> I have a grid and I have added a Selection Listener to it.
> I wanted to know if on executing the following line of code, will this
> listener get invoked:
> grid.setSelection(index).
>
> My requirement is that, when I set the selection to a gridItem using the
> above line of code, the selection listener associated with it should be
> invoked.
>
> I have tried this but the selection listener is not getting fired. How
> can I invoke the listener?
>
> Any suggestion would be appreciated.
>
> Thanks and Regards,
> Asha Subramaniam.
>
>
>
>
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: Does setSelection(index) on a grid invoke the selectionListener attached to it? [message #587544 is a reply to message #46196] |
Thu, 10 January 2008 11:00  |
Eclipse User |
|
|
|
Yes its as Tom says. This is the standard SWT pattern. Since its your
code doing the selection (as opposed to the user) then you can do any
follow on processing that you want (or fire the event as Thomas suggests
with notifyListeners()).
Regards,
-Chris
Tom Schindl wrote:
> This is common to all SWT-Widget and I think Grid behaves like real
> native ones. Setting a selection through code will never trigger an event.
>
> In standard SWT you have to call notifyListener() your own but I don't
> know if this is the same in Nebula-Grid.
>
> Tom
>
> Asha Subramaniam schrieb:
>> Hello all,
>>
>> I have a grid and I have added a Selection Listener to it.
>> I wanted to know if on executing the following line of code, will this
>> listener get invoked:
>> grid.setSelection(index).
>>
>> My requirement is that, when I set the selection to a gridItem using
>> the above line of code, the selection listener associated with it
>> should be invoked.
>>
>> I have tried this but the selection listener is not getting fired. How
>> can I invoke the listener?
>>
>> Any suggestion would be appreciated.
>>
>> Thanks and Regards,
>> Asha Subramaniam.
>>
>>
>>
>>
>>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.06596 seconds