Skip to main content



      Home
Home » Eclipse Projects » Nebula » Does setSelection(index) on a grid invoke the selectionListener attached to it?
Does setSelection(index) on a grid invoke the selectionListener attached to it? [message #46166] Thu, 10 January 2008 06:17 Go to next message
Eclipse UserFriend
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 #46196 is a reply to message #46166] Thu, 10 January 2008 06:29 Go to previous messageGo to next message
Eclipse UserFriend
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 #46226 is a reply to message #46196] Thu, 10 January 2008 11:00 Go to previous messageGo to next message
Eclipse UserFriend
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.
>>
>>
>>
>>
>>
>
>
Re: Does setSelection(index) on a grid invoke the selectionListener attached to it? [message #46321 is a reply to message #46226] Fri, 11 January 2008 01:17 Go to previous message
Eclipse UserFriend
Thanks Tom and Chris,

I will try out the solution.

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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>>
>>
>>
>>
>>
>
>
Re: Does setSelection(index) on a grid invoke the selectionListener attached to it? [message #587569 is a reply to message #46226] Fri, 11 January 2008 01:17 Go to previous message
Eclipse UserFriend
Thanks Tom and Chris,

I will try out the solution.

Regards,
Asha Subramaniam.
Previous Topic:[Grid] How to set RowHeaderWidth ?
Next Topic:Brainstorming: grid as a spreadsheet
Goto Forum:
  


Current Time: Thu May 08 08:17:40 EDT 2025

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

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

Back to the top