Package com.vladsch.plugin.util
Class AwtRunnable
- java.lang.Object
-
- com.vladsch.plugin.util.AwtRunnable
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
OneTimeRunnable
public class AwtRunnable extends java.lang.Object implements java.lang.RunnableUsed to create a task that needs to potentially run on the AwtThread.
-
-
Constructor Summary
Constructors Constructor Description AwtRunnable(boolean awtThread, java.lang.Runnable command)AwtRunnable(boolean awtThread, java.lang.Runnable command, com.intellij.openapi.application.ModalityState modalityState)AwtRunnable(java.lang.Runnable command)AwtRunnable(java.lang.Runnable command, com.intellij.openapi.application.ModalityState modalityState)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.RunnablegetCommand()booleanisAwtThread()voidrun()static CancellableRunnableschedule(CancelableJobScheduler scheduler, @NotNull java.lang.String id, int delay, @NotNull java.lang.Runnable command)static CancellableRunnableschedule(CancelableJobScheduler scheduler, @NotNull java.lang.String id, int delay, @Nullable com.intellij.openapi.application.ModalityState modalityState, @NotNull java.lang.Runnable command)Creates a one-shot runnable that will run after a delay, can be run early, or cancelled
-
-
-
Constructor Detail
-
AwtRunnable
public AwtRunnable(java.lang.Runnable command)
-
AwtRunnable
public AwtRunnable(java.lang.Runnable command, com.intellij.openapi.application.ModalityState modalityState)
-
AwtRunnable
public AwtRunnable(boolean awtThread, java.lang.Runnable command)
-
AwtRunnable
public AwtRunnable(boolean awtThread, java.lang.Runnable command, com.intellij.openapi.application.ModalityState modalityState)
-
-
Method Detail
-
getCommand
public java.lang.Runnable getCommand()
-
isAwtThread
public boolean isAwtThread()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
schedule
public static CancellableRunnable schedule(CancelableJobScheduler scheduler, @NotNull @NotNull java.lang.String id, int delay, @NotNull @NotNull java.lang.Runnable command)
-
schedule
public static CancellableRunnable schedule(CancelableJobScheduler scheduler, @NotNull @NotNull java.lang.String id, int delay, @Nullable @Nullable com.intellij.openapi.application.ModalityState modalityState, @NotNull @NotNull java.lang.Runnable command)
Creates a one-shot runnable that will run after a delay, can be run early, or cancelledthe given command will only be executed once, either by the delayed trigger or by the run method. if you want to execute the task early just invoke #run, it will do nothing if the task has already run.
- Parameters:
scheduler- job scheduler to useid- id of the jobdelay- the time from now to delay executionmodalityState- the modality state to use when invoking the commandcommand- the task to execute- Returns:
- a
CancellableRunnablewhich will run after the given delay on the AwtThread ifrun()is invoked beforeCancellable.cancel() - Throws:
java.lang.NullPointerException- if command is null
-
-