Package com.jetbrains

Interface ToolkitEvents


@Service @Provided public interface ToolkitEvents
Allows an application that has pushed its own EventQueue implementation to receive events generated by AWT via that queue's EventQueue.postEvent(java.awt.AWTEvent) method.

By default, events generated by AWT itself enter the bottom-most (root) EventQueue of the system event queue stack via its EventQueue.postEvent(java.awt.AWTEvent) method, which are then forwarded to the queues up the stack without calling that method again.

Events posted by user applications via methods like EventQueue.invokeLater(java.lang.Runnable) are not affected by this API.

  • Method Details

    • setTargetEventQueue

      EventQueue setTargetEventQueue(EventQueue queue)
      Sets the EventQueue, which EventQueue.postEvent(java.awt.AWTEvent) method is called for events generated by AWT itself.

      Upon the return of this method, it is guaranteed that every new AWT event will be posted to the passed event queue via the EventQueue.postEvent(java.awt.AWTEvent) method. This method may block until the posting of previously generated events completes.

      queue must remain on the stack for the duration of it being used as the AWT's target event queue.

      Parameters:
      queue - new target queue, or null to restore the default (root) queue
      Returns:
      the previous target queue, never null
      Throws:
      IllegalArgumentException - if passed queue is not on the system event queue stack
      IllegalStateException - if the system event queue is not initialized for the calling thread