Package com.intellij.util
Class Alarm
java.lang.Object
com.intellij.util.Alarm
- All Implemented Interfaces:
Disposable
Allows to schedule Runnable instances (requests) to be executed after a specific time interval on a specific thread.
Use
addRequest(java.lang.Runnable, int, boolean) methods to schedule the requests.
Two requests scheduled with the same delay are executed sequentially, one after the other.
cancelAllRequests() and cancelRequest(Runnable) allow to cancel already scheduled requests.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.intellij.openapi.Disposable
Disposable.Parent -
Constructor Summary
ConstructorsConstructorDescriptionAlarm()Creates alarm that works in Swing threadAlarm(Disposable parentDisposable) Alarm(Alarm.ThreadToUse threadToUse) Alarm(Alarm.ThreadToUse threadToUse, Disposable parentDisposable) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequest(Runnable request, int delay, boolean runWithActiveFrameOnly) voidaddRequest(Runnable request, long delayMillis) intbooleancancelRequest(Runnable request) voiddispose()voidflush()intbooleanprotected booleanisEdt()booleanisEmpty()static boolean
-
Constructor Details
-
Alarm
public Alarm()Creates alarm that works in Swing thread -
Alarm
-
Alarm
-
Alarm
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfaceDisposable
-
addRequest
-
addRequest
-
cancelRequest
-
cancelAllRequests
public int cancelAllRequests() -
flush
-
getActiveRequestCount
public int getActiveRequestCount() -
isEmpty
public boolean isEmpty() -
isEdt
protected boolean isEdt() -
isEventDispatchThread
public static boolean isEventDispatchThread() -
isDisposed
public boolean isDisposed()
-