Adds the listener to the collection of listeners who will be notified when the user changes the receiver's selection, by sending it one of the messages defined in the
SelectionListener
interface.
When widgetSelected
is called, the item field of the event object is valid. If the receiver has SWT.CHECK
style set and the check selection changes, the event object detail field contains the value SWT.CHECK
. widgetDefaultSelected
is typically called when an item is double-clicked.
@param listener the listener which should be notified when the user changes the receiver's selection
@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 SelectionEvent
@see #removeSelectionListener(SelectionListener)