Skip to content

Preloading Activity ​

An activity to be executed in background on startup (regardless if some project was opened or not).

See consulo.application.PreloadingActivity.

To register, annotate the implementation class with @ExtensionImpl:

java
@ExtensionImpl
public class CatPreloadingActivity extends PreloadingActivity {
    // ...
}

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 annotate the implementation class with @ExtensionImpl:

java
@ExtensionImpl
public class CatStartupActivity implements StartupActivity {
    // ...
}

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 annotate the implementation class with @ExtensionImpl:

java
@ExtensionImpl
public class CatStartupActivity implements PostStartupActivity {
    // ...
}

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 the ProgressManager API.
  • To execute work in the UI thread, use the application's invokeLater methods with a project-alive condition.
  • Use DumbService to execute work that requires access to indices.