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);
}
}
}
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();
}
}
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();
}
}
Aggregations