public class ApplicationImpl extends ComponentManagerImpl implements ApplicationEx
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static boolean |
USE_SEPARATE_WRITE_THREAD
This boolean controls whether to use thread(s) other than EDT for acquiring IW lock (i.e.
|
ELEVATE, EXIT_CONFIRMED, FORCE_EXIT, LOCATOR_FILE_NAME, SAVE
Constructor and Description |
---|
ApplicationImpl(boolean isInternal,
boolean isUnitTestMode,
boolean isHeadless,
boolean isCommandLine) |
Modifier and Type | Method and Description |
---|---|
AccessToken |
acquireReadActionLock() |
AccessToken |
acquireWriteActionLock(java.lang.Class<?> clazz) |
boolean |
acquireWriteIntentLockIfNeeded()
Private API to use in instrumented code.
|
java.lang.String |
activityNamePrefix() |
void |
addApplicationListener(ApplicationListener l) |
void |
addApplicationListener(ApplicationListener l,
Disposable parent)
Adds an
ApplicationListener . |
void |
assertIsDispatchThread()
Asserts whether the method is being called from the event dispatch thread.
|
void |
assertIsDispatchThread(javax.swing.JComponent component) |
void |
assertIsWriteThread()
Asserts whether the method is being called from under the Write Intent lock
|
void |
assertReadAccessAllowed()
Asserts whether the read access is allowed.
|
void |
assertTimeConsuming() |
void |
assertWriteAccessAllowed()
Asserts whether the write access is allowed.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
disposeContainer() |
void |
executeByImpatientReader(java.lang.Runnable runnable)
Executes a
runnable in an "impatient" mode. |
<T> java.util.concurrent.Future<T> |
executeOnPooledThread(java.util.concurrent.Callable<T> action)
Requests pooled thread to execute the action.
|
java.util.concurrent.Future<?> |
executeOnPooledThread(java.lang.Runnable action)
Requests pooled thread to execute the action.
|
void |
executeSuspendingWriteAction(Project project,
java.lang.String title,
java.lang.Runnable runnable)
If called inside a write action, executes the given code under a modal progress with write lock released (e.g.
|
void |
exit(boolean force,
boolean exitConfirmed,
boolean restart)
There are two ways we can get an exit notification.
|
void |
exit(int flags) |
ModalityState |
getAnyModalityState()
Please use
ModalityState.any() instead, and only if you absolutely must, after carefully reading its documentation. |
protected ContainerDescriptor |
getContainerDescriptor(IdeaPluginDescriptorImpl pluginDescriptor) |
ModalityState |
getCurrentModalityState()
Please use
ModalityState.current() instead. |
ModalityState |
getDefaultModalityState()
Please use
ModalityState.defaultModalityState() instead. |
long |
getIdleTime()
Returns the time in milliseconds during which IDE received no input events.
|
ModalityInvokator |
getInvokator() |
ModalityState |
getModalityStateForComponent(java.awt.Component c)
Please use
ModalityState.stateForComponent(Component) instead. |
ModalityState |
getNoneModalityState()
Please use
ModalityState.NON_MODAL instead. |
long |
getStartTime()
Returns the time of IDE start, in milliseconds since midnight, January 1, 1970 UTC.
|
boolean |
hasWriteAction(java.lang.Class<?> actionClass)
Returns
true if there is currently executing write action of the specified class. |
boolean |
holdsReadLock() |
void |
invokeAndWait(java.lang.Runnable runnable)
|
void |
invokeAndWait(java.lang.Runnable runnable,
ModalityState modalityState)
Causes
runnable.run() to be executed synchronously on the
AWT event dispatching thread under Write Intent lock, when the IDE is in the specified modality
state (or a state with less modal dialogs open). |
void |
invokeLater(java.lang.Runnable runnable)
Causes
runnable.run() to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock, with ModalityState.defaultModalityState() modality state. |
void |
invokeLater(java.lang.Runnable runnable,
Condition<?> expired)
Causes
runnable.run() to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock - unless the expiration condition is fulfilled. |
void |
invokeLater(java.lang.Runnable runnable,
ModalityState state)
Causes
runnable.run() to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock, when IDE is in the specified modality
state (or a state with less modal dialogs open). |
void |
invokeLater(java.lang.Runnable runnable,
ModalityState state,
Condition<?> expired)
Causes
runnable.run() to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock, when IDE is in the specified modality
state(or a state with less modal dialogs open) - unless the expiration condition is fulfilled. |
void |
invokeLaterOnWriteThread(java.lang.Runnable action)
Causes
runnable to be executed asynchronously under Write Intent lock on some thread,
with ModalityState.defaultModalityState() modality state. |
void |
invokeLaterOnWriteThread(java.lang.Runnable action,
ModalityState modal)
Causes
runnable to be executed asynchronously under Write Intent lock on some thread,
when IDE is in the specified modality state (or a state with less modal dialogs open). |
void |
invokeLaterOnWriteThread(java.lang.Runnable action,
ModalityState modal,
Condition<?> expired)
Causes
runnable to be executed asynchronously under Write Intent lock on some thread,
when IDE is in the specified modality state (or a state with less modal dialogs open)
- unless the expiration condition is fulfilled. |
boolean |
isActive()
Checks if the application is active.
|
boolean |
isCommandLine()
Checks if IDE is running as a command line applet or in unit test mode.
|
ThreeState |
isCurrentWriteOnEdt() |
boolean |
isDispatchThread()
Checks if the current thread is the Swing dispatch thread and has IW lock acquired.
|
boolean |
isEAP() |
boolean |
isHeadlessEnvironment()
Checks if IDE is running as a command line applet or in unit test mode.
|
boolean |
isInImpatientReader()
DO NOT USE
|
boolean |
isInternal()
Checks if IDE is running in Internal Mode to enable additional features for plugin development.
|
boolean |
isLightEditMode() |
boolean |
isReadAccessAllowed()
Checks if the read access is currently allowed.
|
boolean |
isRestartCapable()
Checks if IDE is capable of restarting itself on the current platform and with the current execution mode.
|
boolean |
isSaveAllowed() |
boolean |
isUnitTestMode()
Checks if IDE is currently running unit tests.
|
boolean |
isWriteAccessAllowed()
Checks if the write access is currently allowed.
|
boolean |
isWriteActionInProgress() |
boolean |
isWriteActionPending() |
boolean |
isWriteThread()
Checks if the current thread has IW lock acquired, which grants read access and the ability to run write actions.
|
void |
load(java.lang.String configPath)
Loads the application configuration from the specified path
|
void |
loadComponents(ProgressIndicator indicator) |
protected void |
logMessageBusDelivery(Topic<?> topic,
java.lang.String messageName,
java.lang.Object handler,
long duration) |
void |
releaseWriteIntentLockIfNeeded(boolean needed)
Private API to use in instrumented code.
|
void |
removeApplicationListener(ApplicationListener l) |
void |
restart(boolean exitConfirmed) |
void |
restart(boolean exitConfirmed,
boolean elevate)
Restarts the IDE with optional process elevation (on Windows).
|
void |
restart(int flags,
java.lang.String [] beforeRestart) |
void |
runIntendedWriteActionOnCurrentThread(java.lang.Runnable action)
Runs the specified action under Write Intent lock.
|
boolean |
runProcessWithProgressSynchronously(java.lang.Runnable process,
java.lang.String progressTitle,
boolean canBeCanceled,
Project project)
Runs modal process.
|
boolean |
runProcessWithProgressSynchronously(java.lang.Runnable process,
java.lang.String progressTitle,
boolean canBeCanceled,
Project project,
javax.swing.JComponent parentComponent)
Runs modal process.
|
boolean |
runProcessWithProgressSynchronously(java.lang.Runnable process,
java.lang.String progressTitle,
boolean canBeCanceled,
Project project,
javax.swing.JComponent parentComponent,
java.lang.String cancelText)
Runs modal process.
|
boolean |
runProcessWithProgressSynchronouslyInReadAction(Project project,
java.lang.String progressTitle,
boolean canBeCanceled,
java.lang.String cancelText,
javax.swing.JComponent parentComponent,
java.lang.Runnable process)
Executes
process in a separate thread in the application thread pool (see Application.executeOnPooledThread(Runnable) ). |
<T> T |
runReadAction(Computable<T> computation)
Runs the specified computation in a read action.
|
void |
runReadAction(java.lang.Runnable action)
Runs the specified read action.
|
<T,E extends java.lang.Throwable> |
runReadAction(ThrowableComputable<T,E> computation)
Runs the specified computation in a read action.
|
<T,E extends java.lang.Throwable> |
runUnlockingIntendedWrite(ThrowableComputable<T,E> action)
Runs the specified action, releasing Write Intent lock if it is acquired at the moment of the call.
|
<T> T |
runWriteAction(Computable<T> computation)
Runs the specified computation in a write action.
|
void |
runWriteAction(java.lang.Runnable action)
Runs the specified write action.
|
<T,E extends java.lang.Throwable> |
runWriteAction(ThrowableComputable<T,E> computation)
Runs the specified computation in a write action.
|
boolean |
runWriteActionWithCancellableProgressInDispatchThread(java.lang.String title,
Project project,
javax.swing.JComponent parentComponent,
Consumer<? super ProgressIndicator> action) |
boolean |
runWriteActionWithNonCancellableProgressInDispatchThread(java.lang.String title,
Project project,
javax.swing.JComponent parentComponent,
Consumer<? super ProgressIndicator> action) |
void |
saveAll()
Saves all open documents and projects.
|
void |
saveSettings()
Saves application settings.
|
void |
setSaveAllowed(boolean value) |
java.lang.String |
toString() |
boolean |
tryRunReadAction(java.lang.Runnable action)
Tries to acquire the read lock and run the
action |
java.lang.String |
writeActionStatistics() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
doNotSave, exit, exit, load, restart
isDisposeInProgress
createError, createError, getComponent, getComponent, getComponent, getComponentInstancesOfType, getComponentInstancesOfType, getComponents, getDisposed, getExtensionArea, getExtensions, getMessageBus, getPicoContainer, getService, getService, getServiceIfCreated, hasComponent, instantiateClass, instantiateClassWithConstructorInjection, instantiateExtensionWithPicoContainerOnlyIfNeeded, isDisposed, isDisposedOrDisposeInProgress, logError
getUserData, putUserData
public static final boolean USE_SEPARATE_WRITE_THREAD
false
, IW lock will be granted on EDT at all times, guaranteeing the same execution model as before
IW lock introduction.public ApplicationImpl(boolean isInternal, boolean isUnitTestMode, boolean isHeadless, boolean isCommandLine)
public void executeByImpatientReader(java.lang.Runnable runnable) throws ApplicationUtil.CannotRunReadActionException
runnable
in an "impatient" mode.
In this mode any attempt to call runReadAction(Runnable)
would fail (i.e. throw ApplicationUtil.CannotRunReadActionException
)
if there is a pending write action.executeByImpatientReader
in interface ApplicationEx
ApplicationUtil.CannotRunReadActionException
public boolean isInImpatientReader()
ApplicationEx
isInImpatientReader
in interface ApplicationEx
public void disposeContainer()
public boolean holdsReadLock()
holdsReadLock
in interface ApplicationEx
Application.runReadAction(Runnable)
public boolean isInternal()
Application
isInternal
in interface Application
public boolean isEAP()
isEAP
in interface Application
public boolean isUnitTestMode()
Application
invokeLater
in tests, you can call PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
NonBlockingReadActionImpl.waitForAsyncTaskCompletion()
Future
/Promise
/etc callbacks and call PlatformTestUtil.waitFor*
Messages.setTestDialog(...)
UiInterceptors
isUnitTestMode
in interface Application
true
if IDE is running unit tests, false
otherwisepublic boolean isHeadlessEnvironment()
Application
isHeadlessEnvironment
in interface Application
true
if IDE is running in UI-less mode, false
otherwisepublic boolean isCommandLine()
Application
isCommandLine
in interface Application
true
if IDE is running in command line mode, false
otherwisepublic boolean isLightEditMode()
public java.util.concurrent.Future<?> executeOnPooledThread(java.lang.Runnable action)
Application
This pool is an
executeOnPooledThread
in interface Application
action
- to be executedpublic <T> java.util.concurrent.Future<T> executeOnPooledThread(java.util.concurrent.Callable<T> action)
Application
This pool is an
executeOnPooledThread
in interface Application
action
- to be executedpublic boolean isDispatchThread()
Application
isDispatchThread
in interface Application
true
if the current thread is the Swing dispatch thread with IW lock, false
otherwise.Application.isWriteThread()
public boolean isWriteThread()
Application
isWriteThread
in interface Application
true
if the current thread has IW lock acquired, false
otherwise.public ModalityInvokator getInvokator()
getInvokator
in interface Application
public void invokeLater(java.lang.Runnable runnable)
Application
runnable.run()
to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock, with ModalityState.defaultModalityState()
modality state.
This will happen after all pending AWT events have been processed.
Please use this method instead of SwingUtilities.invokeLater(Runnable)
or UIUtil
methods
for the reasons described in ModalityState
documentation.
invokeLater
in interface Application
runnable
- the runnable to execute.public void invokeLater(java.lang.Runnable runnable, Condition<?> expired)
Application
runnable.run()
to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock - unless the expiration condition is fulfilled.
This will happen after all pending AWT events have been processed and in ModalityState.defaultModalityState()
modality state
(or a state with less modal dialogs open).
Please use this method instead of SwingUtilities.invokeLater(Runnable)
or UIUtil
methods
for the reasons described in ModalityState
documentation.
invokeLater
in interface Application
runnable
- the runnable to execute.expired
- condition to check before execution.public void invokeLater(java.lang.Runnable runnable, ModalityState state)
Application
runnable.run()
to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock, when IDE is in the specified modality
state (or a state with less modal dialogs open).
Please use this method instead of SwingUtilities.invokeLater(Runnable)
or UIUtil
methods
for the reasons described in ModalityState
documentation.
invokeLater
in interface Application
runnable
- the runnable to execute.state
- the state in which the runnable will be executed.public void invokeLater(java.lang.Runnable runnable, ModalityState state, Condition<?> expired)
Application
runnable.run()
to be executed asynchronously on the
AWT event dispatching thread under Write Intent lock, when IDE is in the specified modality
state(or a state with less modal dialogs open) - unless the expiration condition is fulfilled.
This will happen after all pending AWT events have been processed.
Please use this method instead of SwingUtilities.invokeLater(Runnable)
or UIUtil
methods
for the reasons described in ModalityState
documentation.
invokeLater
in interface Application
runnable
- the runnable to execute.state
- the state in which the runnable will be executed.expired
- condition to check before execution.public final void load(java.lang.String configPath)
ApplicationEx
load
in interface ApplicationEx
configPath
- Path to /config folderpublic final void loadComponents(ProgressIndicator indicator)
public void dispose()
Disposable
dispose
in interface Disposable
public java.lang.String writeActionStatistics()
public boolean runProcessWithProgressSynchronously(java.lang.Runnable process, java.lang.String progressTitle, boolean canBeCanceled, Project project)
ApplicationEx
Task
runProcessWithProgressSynchronously
in interface ApplicationEx
public boolean runProcessWithProgressSynchronously(java.lang.Runnable process, java.lang.String progressTitle, boolean canBeCanceled, Project project, javax.swing.JComponent parentComponent)
ApplicationEx
Task
runProcessWithProgressSynchronously
in interface ApplicationEx
public boolean runProcessWithProgressSynchronously(java.lang.Runnable process, java.lang.String progressTitle, boolean canBeCanceled, Project project, javax.swing.JComponent parentComponent, java.lang.String cancelText)
ApplicationEx
Task
runProcessWithProgressSynchronously
in interface ApplicationEx
public boolean runProcessWithProgressSynchronouslyInReadAction(Project project, java.lang.String progressTitle, boolean canBeCanceled, java.lang.String cancelText, javax.swing.JComponent parentComponent, java.lang.Runnable process)
ApplicationEx
process
in a separate thread in the application thread pool (see Application.executeOnPooledThread(Runnable)
).
The process is run inside read action (see Application.runReadAction(Runnable)
)
If run from EDT, it is guaranteed that no other read or write action is run before the process start running.
If the process is running for too long, a progress window shown with progressTitle
and a button with cancelText
.runProcessWithProgressSynchronouslyInReadAction
in interface ApplicationEx
public void invokeAndWait(java.lang.Runnable runnable, ModalityState modalityState)
Application
Causes runnable.run()
to be executed synchronously on the
AWT event dispatching thread under Write Intent lock, when the IDE is in the specified modality
state (or a state with less modal dialogs open). This call blocks until all pending AWT events have been processed and (then)
runnable.run()
returns.
If current thread is an event dispatch thread then runnable.run()
is executed immediately regardless of the modality state.
Please use this method instead of SwingUtilities.invokeAndWait(Runnable)
or UIUtil
methods
for the reasons described in ModalityState
documentation.
invokeAndWait
in interface Application
runnable
- the runnable to execute.modalityState
- the state in which the runnable will be executed.public void invokeAndWait(java.lang.Runnable runnable) throws ProcessCanceledException
Application
Application.invokeAndWait(Runnable, ModalityState)
, using ModalityState.defaultModalityState()
.invokeAndWait
in interface Application
ProcessCanceledException
public ModalityState getCurrentModalityState()
Application
ModalityState.current()
instead.getCurrentModalityState
in interface Application
public ModalityState getModalityStateForComponent(java.awt.Component c)
Application
ModalityState.stateForComponent(Component)
instead.getModalityStateForComponent
in interface Application
public ModalityState getAnyModalityState()
Application
ModalityState.any()
instead, and only if you absolutely must, after carefully reading its documentation.getAnyModalityState
in interface Application
public ModalityState getDefaultModalityState()
Application
ModalityState.defaultModalityState()
instead.getDefaultModalityState
in interface Application
public ModalityState getNoneModalityState()
Application
ModalityState.NON_MODAL
instead.getNoneModalityState
in interface Application
public long getStartTime()
Application
getStartTime
in interface Application
public long getIdleTime()
Application
getIdleTime
in interface Application
public final void restart(boolean exitConfirmed)
restart
in interface ApplicationEx
exitConfirmed
- if true, suppresses any shutdown confirmation. However, if there are any background processes or tasks running,
a corresponding confirmation will be shown with the possibility to cancel the operationpublic final void restart(boolean exitConfirmed, boolean elevate)
ApplicationEx
restart
in interface ApplicationEx
exitConfirmed
- if true, the IDE does not ask for exit confirmation.elevate
- if true and the IDE is running on Windows, the IDE is restarted in elevated mode (with admin privileges)public final void exit(boolean force, boolean exitConfirmed, boolean restart)
exit
in interface Application
public void restart(int flags, java.lang.String [] beforeRestart)
public final void exit(int flags)
exit
in interface ApplicationEx
public ThreeState isCurrentWriteOnEdt()
public void invokeLaterOnWriteThread(java.lang.Runnable action, ModalityState modal)
Application
runnable
to be executed asynchronously under Write Intent lock on some thread,
when IDE is in the specified modality state (or a state with less modal dialogs open).invokeLaterOnWriteThread
in interface Application
action
- the runnable to execute.modal
- the state in which action will be executedpublic void invokeLaterOnWriteThread(java.lang.Runnable action, ModalityState modal, Condition<?> expired)
Application
runnable
to be executed asynchronously under Write Intent lock on some thread,
when IDE is in the specified modality state (or a state with less modal dialogs open)
- unless the expiration condition is fulfilled.invokeLaterOnWriteThread
in interface Application
action
- the runnable to execute.modal
- the state in which action will be executedexpired
- condition to check before execution.public void invokeLaterOnWriteThread(java.lang.Runnable action)
Application
runnable
to be executed asynchronously under Write Intent lock on some thread,
with ModalityState.defaultModalityState()
modality state.invokeLaterOnWriteThread
in interface Application
action
- the runnable to execute.public boolean acquireWriteIntentLockIfNeeded()
Application
Acquires IW lock if it's not acquired by the current thread.
acquireWriteIntentLockIfNeeded
in interface Application
true
if IW lock was acquired, or false
if it is held by the current thread already.public void releaseWriteIntentLockIfNeeded(boolean needed)
Application
Releases IW lock if the parameter is true
.
releaseWriteIntentLockIfNeeded
in interface Application
needed
- whether IW lock should be released or notpublic void runIntendedWriteActionOnCurrentThread(java.lang.Runnable action)
Application
This method is used to implement higher-level API, please do not use it directly.
Use Application.invokeLaterOnWriteThread(java.lang.Runnable)
, WriteThread
or AppUIExecutor.onWriteThread()
to
run code under Write Intent lock asynchronously.
runIntendedWriteActionOnCurrentThread
in interface Application
action
- the action to runpublic <T,E extends java.lang.Throwable> T runUnlockingIntendedWrite(ThrowableComputable<T,E> action) throws E extends java.lang.Throwable
Application
This method is used to implement higher-level API, please do not use it directly.
runUnlockingIntendedWrite
in interface Application
E extends java.lang.Throwable
public void runReadAction(java.lang.Runnable action)
Application
See also ReadAction.run(com.intellij.openapi.application.Result<T>)
for a more lambda-friendly version.
runReadAction
in interface Application
action
- the action to run.public <T> T runReadAction(Computable<T> computation)
Application
See also ReadAction.compute(com.intellij.openapi.util.ThrowableComputable<T, E>)
for a more lambda-friendly version.
runReadAction
in interface Application
computation
- the computation to perform.public <T,E extends java.lang.Throwable> T runReadAction(ThrowableComputable<T,E> computation) throws E extends java.lang.Throwable
Application
See also ReadAction.compute(com.intellij.openapi.util.ThrowableComputable<T, E>)
for a more lambda-friendly version.
runReadAction
in interface Application
computation
- the computation to perform.E
- re-frown from ThrowableComputableE extends java.lang.Throwable
public boolean runWriteActionWithNonCancellableProgressInDispatchThread(java.lang.String title, Project project, javax.swing.JComponent parentComponent, Consumer<? super ProgressIndicator> action)
runWriteActionWithNonCancellableProgressInDispatchThread
in interface ApplicationEx
public boolean runWriteActionWithCancellableProgressInDispatchThread(java.lang.String title, Project project, javax.swing.JComponent parentComponent, Consumer<? super ProgressIndicator> action)
runWriteActionWithCancellableProgressInDispatchThread
in interface ApplicationEx
public void runWriteAction(java.lang.Runnable action)
Application
See also WriteAction.run(com.intellij.util.ThrowableRunnable<E>)
for a more lambda-friendly version.
runWriteAction
in interface Application
action
- the action to runpublic <T> T runWriteAction(Computable<T> computation)
Application
See also WriteAction.compute(com.intellij.openapi.util.ThrowableComputable<T, E>)
for a more lambda-friendly version.
runWriteAction
in interface Application
computation
- the computation to runpublic <T,E extends java.lang.Throwable> T runWriteAction(ThrowableComputable<T,E> computation) throws E extends java.lang.Throwable
Application
See also WriteAction.compute(com.intellij.openapi.util.ThrowableComputable<T, E>)
for a more lambda-friendly version.
runWriteAction
in interface Application
computation
- the computation to runE
- re-frown from ThrowableComputableE extends java.lang.Throwable
public boolean hasWriteAction(java.lang.Class<?> actionClass)
Application
true
if there is currently executing write action of the specified class.hasWriteAction
in interface Application
actionClass
- the class of the write action to return.true
if the action is running, or false
if no action of the specified class is currently executing.public void assertReadAccessAllowed()
Application
assertReadAccessAllowed
in interface Application
public boolean isReadAccessAllowed()
Application
isReadAccessAllowed
in interface Application
true
if the read access is currently allowed, false
otherwise.Application.assertReadAccessAllowed()
,
Application.runReadAction(Runnable)
public void assertIsDispatchThread()
Application
assertIsDispatchThread
in interface Application
public void assertIsWriteThread()
Application
assertIsWriteThread
in interface Application
public void assertIsDispatchThread(javax.swing.JComponent component)
assertIsDispatchThread
in interface ApplicationEx
public void assertTimeConsuming()
assertTimeConsuming
in interface ApplicationEx
public boolean tryRunReadAction(java.lang.Runnable action)
ApplicationEx
action
tryRunReadAction
in interface ApplicationEx
public boolean isActive()
Application
isActive
in interface Application
true
if one of application windows is focused, false
otherwisepublic AccessToken acquireReadActionLock()
acquireReadActionLock
in interface Application
public boolean isWriteActionPending()
isWriteActionPending
in interface ApplicationEx
Application.runWriteAction(Runnable)
public AccessToken acquireWriteActionLock(java.lang.Class<?> clazz)
acquireWriteActionLock
in interface Application
public void assertWriteAccessAllowed()
Application
assertWriteAccessAllowed
in interface Application
public boolean isWriteAccessAllowed()
Application
isWriteAccessAllowed
in interface Application
true
if the write access is currently allowed, false
otherwise.Application.assertWriteAccessAllowed()
,
Application.runWriteAction(Runnable)
public boolean isWriteActionInProgress()
isWriteActionInProgress
in interface ApplicationEx
Application.runWriteAction(Runnable)
public void executeSuspendingWriteAction(Project project, java.lang.String title, java.lang.Runnable runnable)
public void addApplicationListener(ApplicationListener l)
addApplicationListener
in interface Application
l
- the listener to addpublic void addApplicationListener(ApplicationListener l, Disposable parent)
Application
ApplicationListener
.addApplicationListener
in interface Application
l
- the listener to addparent
- the parent disposable which dispose will trigger this listener removalpublic void removeApplicationListener(ApplicationListener l)
removeApplicationListener
in interface Application
l
- the listener to removepublic void saveSettings()
Application
saveSettings
in interface Application
public void saveAll()
Application
saveAll
in interface Application
public void setSaveAllowed(boolean value)
setSaveAllowed
in interface ApplicationEx
public boolean isSaveAllowed()
isSaveAllowed
in interface ApplicationEx
public boolean isRestartCapable()
Application
isRestartCapable
in interface Application
true
if IDE can restart itself, false
otherwise.public java.lang.String toString()
public java.lang.String activityNamePrefix()
protected ContainerDescriptor getContainerDescriptor(IdeaPluginDescriptorImpl pluginDescriptor)
protected void logMessageBusDelivery(Topic<?> topic, java.lang.String messageName, java.lang.Object handler, long duration)