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.
When widgetSelected
is called, the x, y, width, and height fields of the event object are valid. If the receiver is being dragged, the event object detail field contains the value SWT.DRAG
. widgetDefaultSelected
is not called.
@param listener the listener which should be notified when the control is selected by the user
@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