public abstract class EdtInvocationManager
extends java.lang.Object
Encapsulates EDT-related checks and processing. The general idea is that IntelliJ threading model is tightly bound with EDT (e.g. write access is allowed from EDT only and any task executed from EDT is implicitly granted read access). That makes a huge bottleneck in non-IntelliJ environments like Upsource - every vcs revision there is represented as a separate ide project object, hence, global shared write lock and single EDT become a problem.
That's why it should be possible to change that model in non-IntelliJ environment - that involves either custom read/write locks processing or custom EDT processing as well. This interface covers EDT part.
Modifier and Type | Class and Description |
---|---|
static class |
EdtInvocationManager.SwingEdtInvocationManager
The default
EdtInvocationManager implementation that uses EventQueue . |
Constructor and Description |
---|
EdtInvocationManager() |
Modifier and Type | Method and Description |
---|---|
static void |
executeWithCustomManager(EdtInvocationManager manager,
java.lang.Runnable runnable) |
static EdtInvocationManager |
getInstance() |
abstract void |
invokeAndWait(java.lang.Runnable task) |
void |
invokeAndWaitIfNeeded(java.lang.Runnable runnable)
Please use Application.invokeAndWait() with a modality state (or GuiUtils, or TransactionGuard methods), unless you work with Swings internals
and 'runnable' deals with Swings components only and doesn't access any PSI, VirtualFiles, project/module model or other project settings.
Invoke and wait in the event dispatch thread
or in the current thread if the current thread
is event queue thread.
|
abstract void |
invokeLater(java.lang.Runnable task) |
abstract boolean |
isEventDispatchThread() |
static void |
setEdtInvocationManager(EdtInvocationManager edtInvocationManager) |
public abstract boolean isEventDispatchThread()
public abstract void invokeLater(java.lang.Runnable task)
public abstract void invokeAndWait(java.lang.Runnable task) throws java.lang.reflect.InvocationTargetException, java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
java.lang.InterruptedException
public static EdtInvocationManager getInstance()
public static void setEdtInvocationManager(EdtInvocationManager edtInvocationManager)
public void invokeAndWaitIfNeeded(java.lang.Runnable runnable)
public static void executeWithCustomManager(EdtInvocationManager manager, java.lang.Runnable runnable)