merged tag ooo/DEV300_m102
[LibreOffice.git] / toolkit / test / accessibility / QueuedListener.java
blobb92d7ac487e61f57655d9a6b7cb747c61ac41e52
1 import com.sun.star.accessibility.*;
2 import com.sun.star.lang.EventObject;
3 import com.sun.star.uno.*;
4 import com.sun.star.accessibility.*;
6 import java.util.LinkedList;
8 class QueuedListener
9 implements XAccessibleEventListener
11 public QueuedListener (EventListener aListener)
13 maListener = aListener;
17 public void disposing( final EventObject aEvent)
19 XAccessibleContext xContext = (XAccessibleContext)UnoRuntime.queryInterface(
20 XAccessibleContext.class, aEvent.Source);
21 if (xContext == null)
23 XAccessible xAccessible = (XAccessible)UnoRuntime.queryInterface(
24 XAccessible.class, aEvent.Source);
25 if (xAccessible != null)
26 xContext = xAccessible.getAccessibleContext();
28 final XAccessibleContext xSource = xContext;
29 EventQueue.Instance().addDisposingEvent (new Runnable()
31 public void run()
33 if (QueuedListener.this.maListener != null)
34 QueuedListener.this.maListener.disposing (xSource);
40 public void notifyEvent( final AccessibleEventObject aEvent )
42 EventQueue.Instance().addEvent (new Runnable()
44 public void run()
46 QueuedListener.this.maListener.notifyEvent( aEvent );
52 private EventListener maListener;