mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
treePM: get rid of duplicate code for ProjectImpl, ModuleImpl, ProjectManagerImpl
Now all code is reused with minimal changes GitOrigin-RevId: 140c89e13c4011a76dc67083ebb40e9525e20542
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f8f06611cd
commit
4557afed00
+7
-2
@@ -289,7 +289,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static ProjectEx doCreateProject(@Nullable String projectName, @NotNull String filePath) {
|
||||
protected ProjectEx doCreateProject(@Nullable String projectName, @NotNull String filePath) {
|
||||
return new ProjectImpl(FileUtilRt.toSystemIndependentName(filePath), projectName);
|
||||
}
|
||||
|
||||
@@ -384,6 +384,8 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
|
||||
Runnable process = () -> {
|
||||
assertInTransaction();
|
||||
|
||||
beforeProjectOpened(project);
|
||||
|
||||
TransactionGuard.getInstance().submitTransactionAndWait(() -> fireProjectOpened(project));
|
||||
|
||||
StartupManagerImpl startupManager = (StartupManagerImpl)StartupManager.getInstance(project);
|
||||
@@ -420,6 +422,9 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void beforeProjectOpened(Project project) {
|
||||
}
|
||||
|
||||
private static void assertInTransaction() {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode() &&
|
||||
ApplicationManager.getApplication().isInternal() &&
|
||||
@@ -753,7 +758,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
|
||||
LOG.assertTrue(removed);
|
||||
}
|
||||
|
||||
private void fireProjectOpened(@NotNull Project project) {
|
||||
protected void fireProjectOpened(@NotNull Project project) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("projectOpened");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user