public class TransactionGuardImpl extends TransactionGuard
Constructor and Description |
---|
TransactionGuardImpl() |
Modifier and Type | Method and Description |
---|---|
void |
assertWriteActionAllowed() |
void |
assertWriteSafeContext(ModalityState modality)
Logs an error if the given modality state was created in a write-unsafe context.
|
void |
enteredModality(ModalityState modality) |
com.intellij.openapi.application.TransactionGuardImpl.TransactionIdImpl |
getContextTransaction() |
boolean |
isWriteSafeModality(ModalityState state)
Checks whether a given modality is write-safe.
|
boolean |
isWritingAllowed()
Checks whether the current state allows for writing the model.
|
void |
performUserActivity(java.lang.Runnable activity)
An absolutely guru method!
Executes the given code and marks it as a user activity, to allow write actions to be run without requiring transactions.
|
AccessToken |
startActivity(boolean userActivity)
An absolutely guru method, only intended to be used from Swing event processing.
|
void |
submitTransaction(Disposable parentDisposable,
TransactionId expectedContext,
java.lang.Runnable transaction) |
void |
submitTransactionAndWait(java.lang.Runnable runnable) |
void |
submitTransactionLater(Disposable parentDisposable,
java.lang.Runnable transaction) |
java.lang.String |
toString() |
java.lang.Runnable |
wrapLaterInvocation(java.lang.Runnable runnable,
ModalityState modalityState) |
getInstance, submitTransaction
public void submitTransaction(Disposable parentDisposable, TransactionId expectedContext, java.lang.Runnable transaction)
submitTransaction
in class TransactionGuard
public void submitTransactionAndWait(java.lang.Runnable runnable) throws ProcessCanceledException
submitTransactionAndWait
in class TransactionGuard
ProcessCanceledException
public void performUserActivity(java.lang.Runnable activity)
ActionManager.tryToExecute()
instead, or ensure in some other way that the action is enabled
and can be invoked in the current modality state.public AccessToken startActivity(boolean userActivity)
public boolean isWritingAllowed()
TransactionGuard
isWritingAllowed
in class TransactionGuard
true
is current context is write-safe, false
otherwisepublic boolean isWriteSafeModality(ModalityState state)
TransactionGuard
isWriteSafeModality
in class TransactionGuard
state
- modality to checktrue
if a given modality is write-safe, false
otherwisepublic void assertWriteActionAllowed()
public void assertWriteSafeContext(ModalityState modality)
TransactionGuard
Application.invokeLater(Runnable, ModalityState)
and similar calls will be guaranteed to also run in a write-safe context.
ModalityState.NON_MODAL
is always write-safe, ModalityState.any()
is always write-unsafe.assertWriteSafeContext
in class TransactionGuard
public void submitTransactionLater(Disposable parentDisposable, java.lang.Runnable transaction)
submitTransactionLater
in class TransactionGuard
public com.intellij.openapi.application.TransactionGuardImpl.TransactionIdImpl getContextTransaction()
getContextTransaction
in class TransactionGuard
public void enteredModality(ModalityState modality)
public java.lang.Runnable wrapLaterInvocation(java.lang.Runnable runnable, ModalityState modalityState)
public java.lang.String toString()
toString
in class java.lang.Object