add javadoc to PlatformTestUtil.dispatch* methods (IDEA-CR-18810)

This commit is contained in:
peter
2017-03-02 14:02:47 +01:00
parent 306802da69
commit fb6ce87ca8
@@ -302,6 +302,10 @@ public class PlatformTestUtil {
UIUtil.dispatchAllInvocationEvents();
}
/**
* 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();
@@ -315,6 +319,10 @@ public class PlatformTestUtil {
}
}
/**
* Dispatch all pending events (if any) in the {@link IdeEventQueue}.
* Should only be invoked in Swing thread (asserted inside {@link IdeEventQueue#dispatchEvent(AWTEvent)})
*/
@TestOnly
public static void dispatchAllEventsInIdeEventQueue() throws InterruptedException {
IdeEventQueue eventQueue = IdeEventQueue.getInstance();
@@ -322,6 +330,10 @@ public class PlatformTestUtil {
while (dispatchNextEventIfAny(eventQueue) != null);
}
/**
* Dispatch one pending event (if any) in the {@link IdeEventQueue}.
* Should only be invoked in Swing thread (asserted inside {@link IdeEventQueue#dispatchEvent(AWTEvent)})
*/
@TestOnly
public static AWTEvent dispatchNextEventIfAny(@NotNull IdeEventQueue eventQueue) throws InterruptedException {
assert SwingUtilities.isEventDispatchThread() : Thread.currentThread();