public interface ApplicationEx extends Application
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static int |
ELEVATE |
static int |
EXIT_CONFIRMED |
static int |
FORCE_EXIT |
static java.lang.String |
LOCATOR_FILE_NAME |
static int |
SAVE |
Modifier and Type | Method and Description |
---|---|
void |
assertIsDispatchThread(javax.swing.JComponent component) |
void |
assertTimeConsuming() |
default void |
doNotSave()
Deprecated.
use
setSaveAllowed(boolean) with false |
default void |
executeByImpatientReader(java.lang.Runnable runnable)
DO NOT USE
|
default void |
exit()
Exits the application, showing the exit confirmation prompt if it is enabled.
|
default void |
exit(boolean force,
boolean exitConfirmed) |
default void |
exit(int flags) |
boolean |
holdsReadLock() |
default boolean |
isInImpatientReader()
DO NOT USE
|
boolean |
isSaveAllowed() |
boolean |
isWriteActionInProgress() |
boolean |
isWriteActionPending() |
default void |
load() |
void |
load(java.lang.String configPath)
Loads the application configuration from the specified path
|
default void |
restart()
Exits and restarts IDE.
|
void |
restart(boolean exitConfirmed) |
void |
restart(boolean exitConfirmed,
boolean elevate)
Restarts the IDE with optional process elevation (on Windows).
|
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) ). |
default boolean |
runWriteActionWithCancellableProgressInDispatchThread(java.lang.String title,
Project project,
javax.swing.JComponent parentComponent,
Consumer<? super ProgressIndicator> action) |
default boolean |
runWriteActionWithNonCancellableProgressInDispatchThread(java.lang.String title,
Project project,
javax.swing.JComponent parentComponent,
Consumer<? super ProgressIndicator> action) |
void |
setSaveAllowed(boolean value) |
boolean |
tryRunReadAction(java.lang.Runnable action)
Tries to acquire the read lock and run the
action |
acquireReadActionLock, acquireWriteActionLock, acquireWriteIntentLockIfNeeded, addApplicationListener, addApplicationListener, assertIsDispatchThread, assertIsWriteThread, assertReadAccessAllowed, assertWriteAccessAllowed, executeOnPooledThread, executeOnPooledThread, exit, getAnyModalityState, getCurrentModalityState, getDefaultModalityState, getIdleTime, getInvokator, getModalityStateForComponent, getNoneModalityState, getStartTime, hasWriteAction, invokeAndWait, invokeAndWait, invokeLater, invokeLater, invokeLater, invokeLater, invokeLaterOnWriteThread, invokeLaterOnWriteThread, invokeLaterOnWriteThread, isActive, isCommandLine, isDispatchThread, isDisposeInProgress, isEAP, isHeadlessEnvironment, isInternal, isReadAccessAllowed, isRestartCapable, isUnitTestMode, isWriteAccessAllowed, isWriteThread, releaseWriteIntentLockIfNeeded, removeApplicationListener, runIntendedWriteActionOnCurrentThread, runReadAction, runReadAction, runReadAction, runUnlockingIntendedWrite, runWriteAction, runWriteAction, runWriteAction, saveAll, saveSettings
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
dispose
static final java.lang.String LOCATOR_FILE_NAME
static final int FORCE_EXIT
static final int EXIT_CONFIRMED
static final int SAVE
static final int ELEVATE
void load(java.lang.String configPath)
configPath
- Path to /config folderdefault void load()
boolean holdsReadLock()
Application.runReadAction(Runnable)
boolean isWriteActionInProgress()
Application.runWriteAction(Runnable)
boolean isWriteActionPending()
Application.runWriteAction(Runnable)
boolean isSaveAllowed()
void setSaveAllowed(boolean value)
@Deprecated default void doNotSave()
setSaveAllowed(boolean)
with false
boolean runProcessWithProgressSynchronouslyInReadAction(Project project, java.lang.String progressTitle, boolean canBeCanceled, java.lang.String cancelText, javax.swing.JComponent parentComponent, java.lang.Runnable process)
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
.default void exit(int flags)
default void exit()
Application
exit
in interface Application
default void exit(boolean force, boolean exitConfirmed)
force
- if true, no additional confirmations will be shown. The application is guaranteed to exitexitConfirmed
- 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 operationvoid restart(boolean exitConfirmed)
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 operationdefault void restart()
Application
restart
in interface Application
void restart(boolean exitConfirmed, boolean elevate)
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)boolean runProcessWithProgressSynchronously(java.lang.Runnable process, java.lang.String progressTitle, boolean canBeCanceled, Project project)
Task
boolean runProcessWithProgressSynchronously(java.lang.Runnable process, java.lang.String progressTitle, boolean canBeCanceled, Project project, javax.swing.JComponent parentComponent)
Task
boolean runProcessWithProgressSynchronously(java.lang.Runnable process, java.lang.String progressTitle, boolean canBeCanceled, Project project, javax.swing.JComponent parentComponent, java.lang.String cancelText)
Task
void assertIsDispatchThread(javax.swing.JComponent component)
void assertTimeConsuming()
boolean tryRunReadAction(java.lang.Runnable action)
action
default void executeByImpatientReader(java.lang.Runnable runnable) throws ApplicationUtil.CannotRunReadActionException
default boolean runWriteActionWithCancellableProgressInDispatchThread(java.lang.String title, Project project, javax.swing.JComponent parentComponent, Consumer<? super ProgressIndicator> action)
default boolean runWriteActionWithNonCancellableProgressInDispatchThread(java.lang.String title, Project project, javax.swing.JComponent parentComponent, Consumer<? super ProgressIndicator> action)
default boolean isInImpatientReader()