Startup Activity
Preloading Activity
An activity to be executed in background on startup (regardless if some project was opened or not).
See PreloadingActivity.
To register:
<extensions defaultExtensionNs="com.intellij">
<preloadingActivity implementation="com.example.CatPreloadingActivity"/>
</extensions>
Startup Activity
An activity to be executed as part of project opening, under 'Loading Project' dialog. Can't be registered by plugins.
To register: StartupManager.registerStartupActivity
or
<extensions defaultExtensionNs="com.intellij">
<startupActivity implementation="com.example.CatStartupActivity"/>
</extensions>
Post Startup Activity
An activity to be executed after project opening.
If activity implements DumbAware, it is executed after project is opened on a background thread with no visible progress indicator and regardless of the current indexing mode. Otherwise, it is executed on EDT and when indexes are ready.
To register: StartupManager.registerPostStartupActivity
or
<extensions defaultExtensionNs="com.intellij">
<postStartupActivity implementation="com.example.CatStartupActivity"/>
</extensions>
See also backgroundPostStartupActivity
that acts as postStartupActivity
but is executed with 5 seconds delay after project opening.
- Use ProgressManager.run(Task.Backgroundable) to execute work that needs to be visible to users. Including work that consumes CPU over a noticeable period. Using of
Application.executeOnPooledThread
is not needed if you use theProgressManager
API. - Use AppUiUtil.invokeLaterIfProjectAlive to execute work that needs to be performed in the UI thread.
- Use DumbService to execute work that requires access to indices.