mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] StartupManager: deprecations, javadoc
GitOrigin-RevId: 90f00446bb46b4bac51364a22cd872508fa2ee0f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a5531b8f24
commit
36046b5513
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.startup;
|
||||
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import kotlinx.coroutines.Job;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@@ -10,39 +11,35 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Allows registering activities that are run during project loading.
|
||||
*
|
||||
* @see ProjectActivity
|
||||
* @see StartupActivity
|
||||
* @see <a href="https://plugins.jetbrains.com/docs/intellij/plugin-components.html#project-open">IntelliJ Platform Docs</a>
|
||||
*/
|
||||
public abstract class StartupManager {
|
||||
/**
|
||||
* Returns the startup manager instance for the specified project.
|
||||
*
|
||||
* @param project the project for which the instance should be returned.
|
||||
* @return the startup manager instance.
|
||||
* @return Startup manager instance for the specified project.
|
||||
*/
|
||||
public static StartupManager getInstance(@NotNull Project project) {
|
||||
return project.getService(StartupManager.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an activity that is performed during project load while the "Loading Project"
|
||||
* progress bar is displayed. You may NOT access the PSI structures from the activity.
|
||||
* Registers an activity that is performed during the project load while the "Loading Project"
|
||||
* progress bar is displayed.
|
||||
* You may NOT access PSI from this activity.
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public abstract void registerStartupActivity(@NotNull Runnable runnable);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #runAfterOpened}.
|
||||
* @deprecated Consider using extension point {@link ProjectActivity} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void registerPostStartupActivity(@NotNull Runnable runnable);
|
||||
|
||||
/**
|
||||
* Registers activity that is executed on pooled thread after project is opened.
|
||||
* The runnable will be executed in current thread if project is already opened.</p>
|
||||
* <p>
|
||||
* See <a href="https://github.com/JetBrains/intellij-community/blob/master/platform/service-container/overview.md#startup-activity">docs</a> for details.
|
||||
* <p>
|
||||
* Consider using extension point {@link ProjectActivity}/{@link StartupActivity} instead.
|
||||
* Registers activity that is executed on pooled thread after the project is opened.
|
||||
* The runnable will be executed in the current thread if the project is already opened.
|
||||
*
|
||||
* @implNote Consider using extension point {@link ProjectActivity} instead.
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public abstract void runAfterOpened(@NotNull Runnable runnable);
|
||||
@@ -50,15 +47,15 @@ public abstract class StartupManager {
|
||||
public abstract boolean postStartupActivityPassed();
|
||||
|
||||
/**
|
||||
* Registers activity that is executed after project is opened.
|
||||
* Registers activity that is executed after the project is opened.
|
||||
* If runnable implements {@link DumbAware}, it will be executed on EDT thread in a non-modal state.
|
||||
* Otherwise, it will be executed on EDT when indexes are ready.
|
||||
* <p>
|
||||
* The runnable can be executed immediately if method is called from EDT and project is already opened.
|
||||
* <p>
|
||||
* The runnable can be executed immediately if the method is called from EDT and the project is already opened.
|
||||
*
|
||||
* @deprecated Use {@link #runAfterOpened}.
|
||||
* @deprecated Consider using extension point {@link ProjectActivity} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void runWhenProjectIsInitialized(@NotNull Runnable runnable);
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
Reference in New Issue
Block a user