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 <code>SelectionListener</code>
interface.
<p>
<code>widgetSelected</code> is not called for texts.
<code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text,
or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.CANCEL</code> style
and the user cancels the search, the event object detail field contains the value <code>SWT.CANCEL</code>.
</p>
@param listener the listener which should be notified when the control is selected by the user
@exception IllegalArgumentException <ul>
<li>ERROR_NULL_ARGUMENT - if the listener is null</li>
</ul>
@exception SWTException <ul>
<li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
<li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
</ul>
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 <code>SelectionListener</code> interface. <p> <code>widgetSelected</code> is not called for texts. <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text, or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.CANCEL</code> style and the user cancels the search, the event object detail field contains the value <code>SWT.CANCEL</code>. </p>
@param listener the listener which should be notified when the control is selected by the user
@exception IllegalArgumentException <ul> <li>ERROR_NULL_ARGUMENT - if the listener is null</li> </ul> @exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>
@see SelectionListener @see #removeSelectionListener @see SelectionEvent