public class ApplicationUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ApplicationUtil.CannotRunReadActionException |
Constructor and Description |
---|
ApplicationUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
acquireWriteIntentLockIfNeeded() |
static void |
invokeAndWaitSomewhere(java.lang.Runnable runnable,
EdtReplacementThread thread) |
static void |
invokeAndWaitSomewhere(java.lang.Runnable r,
EdtReplacementThread thread,
ModalityState modalityState) |
static void |
invokeLaterSomewhere(java.lang.Runnable r,
EdtReplacementThread thread) |
static void |
invokeLaterSomewhere(java.lang.Runnable r,
EdtReplacementThread thread,
ModalityState modalityState) |
static void |
releaseWriteIntentLockIfNeeded(boolean needed) |
static <T> T |
runWithCheckCanceled(java.util.concurrent.Callable<T> callable,
ProgressIndicator indicator)
Allows to interrupt a process which does not performs checkCancelled() calls by itself.
|
static <T> T |
runWithCheckCanceled(java.util.concurrent.Future<T> future,
ProgressIndicator indicator)
Waits for
future to be complete, or the current thread's indicator to be canceled. |
static void |
showDialogAfterWriteAction(java.lang.Runnable runnable) |
static <T> T |
tryRunReadAction(Computable<T> computable) |
static void |
tryRunReadAction(java.lang.Runnable computable) |
public static boolean acquireWriteIntentLockIfNeeded()
public static void releaseWriteIntentLockIfNeeded(boolean needed)
public static <T> T tryRunReadAction(Computable<T> computable) throws ApplicationUtil.CannotRunReadActionException
public static void tryRunReadAction(java.lang.Runnable computable) throws ApplicationUtil.CannotRunReadActionException
public static <T> T runWithCheckCanceled(java.util.concurrent.Callable<T> callable, ProgressIndicator indicator) throws java.lang.Exception
java.lang.Exception
public static <T> T runWithCheckCanceled(java.util.concurrent.Future<T> future, ProgressIndicator indicator) throws java.util.concurrent.ExecutionException
future
to be complete, or the current thread's indicator to be canceled.
Note that future
will not be cancelled by this method.ProgressIndicatorUtils.awaitWithCheckCanceled(Future)
which throws no checked exceptions.java.util.concurrent.ExecutionException
public static void showDialogAfterWriteAction(java.lang.Runnable runnable)
public static void invokeLaterSomewhere(java.lang.Runnable r, EdtReplacementThread thread)
public static void invokeLaterSomewhere(java.lang.Runnable r, EdtReplacementThread thread, ModalityState modalityState)
public static void invokeAndWaitSomewhere(java.lang.Runnable runnable, EdtReplacementThread thread)
public static void invokeAndWaitSomewhere(java.lang.Runnable r, EdtReplacementThread thread, ModalityState modalityState)