Adds the listener to the collection of listeners who will
be notified when an event of the given type occurs anywhere
in a widget. The event type is one of the event constants
defined in class <code>SWT</code>. When the event does occur,
the listener is notified by sending it the <code>handleEvent()</code>
message.
<p>
Setting the type of an event to <code>SWT.None</code> from
within the <code>handleEvent()</code> method can be used to
change the event type and stop subsequent Java listeners
from running. Because event filters run before other listeners,
event filters can both block other listeners and set arbitrary
fields within an event. For this reason, event filters are both
powerful and dangerous. They should generally be avoided for
performance, debugging and code maintenance reasons.
</p>
@param eventType the type of event to listen for
@param listener the listener which should be notified when the event occurs
@exception IllegalArgumentException <ul>
<li>ERROR_NULL_ARGUMENT - if the listener is null</li>
</ul>
@exception SWTException <ul>
<li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
<li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
</ul>
Adds the listener to the collection of listeners who will be notified when an event of the given type occurs anywhere in a widget. The event type is one of the event constants defined in class <code>SWT</code>. When the event does occur, the listener is notified by sending it the <code>handleEvent()</code> message. <p> Setting the type of an event to <code>SWT.None</code> from within the <code>handleEvent()</code> method can be used to change the event type and stop subsequent Java listeners from running. Because event filters run before other listeners, event filters can both block other listeners and set arbitrary fields within an event. For this reason, event filters are both powerful and dangerous. They should generally be avoided for performance, debugging and code maintenance reasons. </p>
@param eventType the type of event to listen for @param listener the listener which should be notified when the event occurs
@exception IllegalArgumentException <ul> <li>ERROR_NULL_ARGUMENT - if the listener is null</li> </ul> @exception SWTException <ul> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> </ul>
@see Listener @see SWT @see #removeFilter @see #removeListener
@since 3.0