use of com.intellij.openapi.startup.StartupActivity in project intellij-community by JetBrains.
the class ExternalSystemStartupActivity method runActivity.
@Override
public void runActivity(@NotNull final Project project) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
return;
}
Runnable task = () -> {
for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemApiUtil.getAllManagers()) {
if (manager instanceof StartupActivity) {
((StartupActivity) manager).runActivity(project);
}
}
if (project.getUserData(ExternalSystemDataKeys.NEWLY_IMPORTED_PROJECT) != Boolean.TRUE) {
for (ExternalSystemManager manager : ExternalSystemManager.EP_NAME.getExtensions()) {
final boolean isNewProject = project.getUserData(ExternalSystemDataKeys.NEWLY_CREATED_PROJECT) == Boolean.TRUE;
if (isNewProject) {
ExternalSystemUtil.refreshProjects(new ImportSpecBuilder(project, manager.getSystemId()).createDirectoriesForEmptyContentRoots());
}
}
}
ExternalToolWindowManager.handle(project);
ExternalSystemVcsRegistrar.handle(project);
ProjectRenameAware.beAware(project);
};
ExternalProjectsManager.getInstance(project).init();
DumbService.getInstance(project).runWhenSmart(DisposeAwareRunnable.create(task, project));
}
use of com.intellij.openapi.startup.StartupActivity in project intellij by bazelbuild.
the class CidrSymbolBuilderSuppressor method addFiltersToStartupActivities.
private void addFiltersToStartupActivities() {
ExtensionPoint<StartupActivity> ep = Extensions.getRootArea().getExtensionPoint(StartupActivity.POST_STARTUP_ACTIVITY);
for (Class<? extends StartupActivity> startupActivity : CidrStartupActivitiesToSuppress.STARTUP_ACTIVITIES_TO_SUPPRESS) {
StartupActivity startupActivityInstance = StartupActivity.POST_STARTUP_ACTIVITY.findExtension(startupActivity);
Preconditions.checkNotNull(startupActivityInstance);
StartupActivity replacementStartupActivity = new BlazeSuppressStartupActivity(startupActivityInstance);
ep.registerExtension(replacementStartupActivity, LoadingOrder.before(startupActivity.getSimpleName()));
ep.unregisterExtension(startupActivityInstance);
}
}
Aggregations