Search in sources :

Example 1 with IdeEventQueue

use of com.intellij.ide.IdeEventQueue in project intellij-community by JetBrains.

the class PlatformTestUtil method dispatchAllInvocationEventsInIdeEventQueue.

/**
   * Dispatch all pending invocation events (if any) in the {@link IdeEventQueue}.
   * Should only be invoked in Swing thread (asserted inside {@link IdeEventQueue#dispatchEvent(AWTEvent)})
   */
@TestOnly
public static void dispatchAllInvocationEventsInIdeEventQueue() throws InterruptedException {
    IdeEventQueue eventQueue = IdeEventQueue.getInstance();
    while (true) {
        AWTEvent event = eventQueue.peekEvent();
        if (event == null)
            break;
        AWTEvent event1 = eventQueue.getNextEvent();
        if (event1 instanceof InvocationEvent) {
            eventQueue.dispatchEvent(event1);
        }
    }
}
Also used : InvocationEvent(java.awt.event.InvocationEvent) IdeEventQueue(com.intellij.ide.IdeEventQueue)

Example 2 with IdeEventQueue

use of com.intellij.ide.IdeEventQueue in project intellij-community by JetBrains.

the class IdeGlassPaneImpl method applyActivationState.

private void applyActivationState() {
    boolean wasVisible = isVisible();
    boolean hasWork = getPainters().hasPainters() || getComponentCount() > 0;
    if (wasVisible != hasWork) {
        setVisible(hasWork);
    }
    IdeEventQueue queue = IdeEventQueue.getInstance();
    if (!queue.containsDispatcher(this) && (myPreprocessorActive || isVisible())) {
        queue.addDispatcher(this, null);
    } else if (queue.containsDispatcher(this) && !myPreprocessorActive && !isVisible()) {
        queue.removeDispatcher(this);
    }
    if (wasVisible != isVisible()) {
        revalidate();
        repaint();
    }
}
Also used : IdeEventQueue(com.intellij.ide.IdeEventQueue)

Example 3 with IdeEventQueue

use of com.intellij.ide.IdeEventQueue in project intellij-community by JetBrains.

the class EditorGutterComponentImpl method processClose.

private void processClose(final MouseEvent e) {
    final IdeEventQueue queue = IdeEventQueue.getInstance();
    if (getGutterRenderer(e) != null)
        return;
    if (myEditor.getMouseEventArea(e) == EditorMouseEventArea.ANNOTATIONS_AREA) {
        queue.blockNextEvents(e);
        closeAllAnnotations();
        e.consume();
    }
}
Also used : IdeEventQueue(com.intellij.ide.IdeEventQueue)

Aggregations

IdeEventQueue (com.intellij.ide.IdeEventQueue)3 InvocationEvent (java.awt.event.InvocationEvent)1