Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the
SelectionListener
interface.
widgetSelected
is called when the control is selected by the user. widgetDefaultSelected
is not called.
When the SWT.RADIO
style bit is set, the widgetSelected
method is also called when the receiver loses selection because another item in the same radio group was selected by the user. During widgetSelected
the application can use getSelection()
to determine the current selected state of the receiver.
@param listener the listener which should be notified
@exception IllegalArgumentException
- ERROR_NULL_ARGUMENT - if the listener is null
@exception SWTException
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
@see SelectionListener
@see #removeSelectionListener
@see SelectionEvent