mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-371331 Current project is not added to newly created workspace
test GitOrigin-RevId: 3b2d1cd10f5fe922e42315014f3b0cb155a685d6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8d8c88c1e3
commit
521bc518aa
@@ -11575,7 +11575,7 @@ f:com.intellij.openapi.wm.impl.WindowManagerImpl
|
||||
- setWindowShadow(java.awt.Window,com.intellij.openapi.wm.ex.WindowManagerEx$WindowShadowMode):V
|
||||
- suggestParentWindow(com.intellij.openapi.project.Project):java.awt.Window
|
||||
- updateDefaultFrameInfoOnProjectClose(com.intellij.openapi.project.Project):V
|
||||
- f:withFrameReuseEnabled():java.lang.AutoCloseable
|
||||
- withFrameReuseEnabled():java.lang.AutoCloseable
|
||||
c:com.intellij.openapi.wm.impl.content.BaseLabel
|
||||
- javax.swing.JLabel
|
||||
- p:myUi:com.intellij.openapi.wm.impl.content.ToolWindowContentUi
|
||||
|
||||
@@ -63,6 +63,7 @@ import com.intellij.openapi.vfs.impl.ZipHandler
|
||||
import com.intellij.openapi.vfs.impl.jar.TimedZipHandler
|
||||
import com.intellij.openapi.wm.IdeFocusManager
|
||||
import com.intellij.openapi.wm.WindowManager
|
||||
import com.intellij.openapi.wm.ex.WindowManagerEx
|
||||
import com.intellij.openapi.wm.impl.WindowManagerImpl
|
||||
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame
|
||||
import com.intellij.platform.PlatformProjectOpenProcessor
|
||||
@@ -1045,7 +1046,7 @@ open class ProjectManagerImpl : ProjectManagerEx(), Disposable {
|
||||
return withContext(Dispatchers.EDT) {
|
||||
try {
|
||||
writeIntentReadAction {
|
||||
(WindowManager.getInstance() as WindowManagerImpl).withFrameReuseEnabled().use {
|
||||
(WindowManager.getInstance() as WindowManagerEx).withFrameReuseEnabled().use {
|
||||
closeProject(project, checkCanClose = true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,4 +83,9 @@ public abstract class WindowManagerEx extends WindowManager {
|
||||
|
||||
@ApiStatus.Internal
|
||||
public abstract @NotNull List<ProjectFrameHelper> getProjectFrameHelpers();
|
||||
|
||||
@ApiStatus.Internal
|
||||
public @NotNull AutoCloseable withFrameReuseEnabled() {
|
||||
return () -> {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ class WindowManagerImpl : WindowManagerEx(), PersistentStateComponentWithModific
|
||||
frameToReuse.getAndSet(null)?.doDispose()
|
||||
}
|
||||
|
||||
fun withFrameReuseEnabled(): AutoCloseable {
|
||||
override fun withFrameReuseEnabled(): AutoCloseable {
|
||||
val oldValue = frameReuseEnabled
|
||||
frameReuseEnabled = true
|
||||
return AutoCloseable { frameReuseEnabled = oldValue }
|
||||
|
||||
+7
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.maven.indices
|
||||
|
||||
import com.intellij.ide.GeneralSettings
|
||||
import com.intellij.ide.projectWizard.ProjectWizardTestCase
|
||||
import com.intellij.ide.util.newProjectWizard.AbstractProjectWizard
|
||||
import com.intellij.maven.testFramework.MavenTestCaseLegacy
|
||||
@@ -27,10 +28,16 @@ class MavenMultiProjectImportTest : ProjectWizardTestCase<AbstractProjectWizard?
|
||||
override fun runInDispatchThread() = false
|
||||
private var myDir: Path? = null
|
||||
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
GeneralSettings.getInstance().confirmOpenNewProject = GeneralSettings.OPEN_PROJECT_NEW_WINDOW
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
RunAll(
|
||||
ThrowableRunnable {
|
||||
super.tearDown()
|
||||
GeneralSettings.getInstance().confirmOpenNewProject = GeneralSettings.defaultConfirmNewProject()
|
||||
},
|
||||
ThrowableRunnable { MavenServerManager.getInstance().closeAllConnectorsAndWait() }
|
||||
).run()
|
||||
|
||||
Reference in New Issue
Block a user