Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Centralized event manager
Centralized event manager [message #444637] Mon, 18 October 2004 14:52 Go to next message
Eclipse UserFriend
Originally posted by: Sir_Galahad.gmx.at

It is possible in AWT/Swing to listen to any event with the help of
centralized event managers. Two examples follow to clarify what I mean:

// To listen to all keyboard events:
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKey EventDispatcher(someListener);

// To listen to all mouse events:
Toolkit.getDefaultToolkit().addAWTEventListener(someListener ,
someEventMask);

Is there a similar possibility in SWT?

Many thanks in advance
Re: Centralized event manager [message #444638 is a reply to message #444637] Mon, 18 October 2004 15:07 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
See Display.addFilter.

/**
* Adds the listener to the collection of listeners who will
* be notifed when an event of the given type occurs anywhere
* in a widget. When the event does occur, the listener is
* notified by sending it the <code>handleEvent()</code> message.
*
* @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 #removeFilter
* @see #removeListener
*
* @since 3.0
*/
public void addFilter (int eventType, Listener listener) {


"Galahad" <Sir_Galahad@gmx.at> wrote in message
news:cl0lc8$gec$1@eclipse.org...
> It is possible in AWT/Swing to listen to any event with the help of
> centralized event managers. Two examples follow to clarify what I mean:
>
> // To listen to all keyboard events:
> KeyboardFocusManager.getCurrentKeyboardFocusManager().addKey EventDispatcher(someListener);
>
> // To listen to all mouse events:
> Toolkit.getDefaultToolkit().addAWTEventListener(someListener ,
> someEventMask);
>
> Is there a similar possibility in SWT?
>
> Many thanks in advance
>
>
Previous Topic:performOK not called (Properties)
Next Topic:MessageBox position
Goto Forum:
  


Current Time: Thu Oct 29 13:00:56 GMT 2020

Powered by FUDForum. Page generated in 0.01378 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top