mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[ByteCodeViewer] IDEA-375222 React to changes of app-wide setting "Show directory for non-unique file names"
GitOrigin-RevId: 08251286b53afcff78ba5663846bc6d5af5eab3c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1034a8e9f4
commit
21de45b3d1
@@ -3,6 +3,7 @@ package com.intellij.byteCodeViewer
|
||||
|
||||
import com.intellij.filename.UniqueNameBuilder
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.ide.ui.UISettingsListener
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Disposer
|
||||
@@ -35,6 +36,11 @@ class BytecodeToolWindowService(private val project: Project) {
|
||||
return
|
||||
}
|
||||
|
||||
val messageBusConnection = project.messageBus.connect(toolWindow.disposable)
|
||||
messageBusConnection.subscribe(UISettingsListener.TOPIC, UISettingsListener {
|
||||
deduplicateTabNames(toolWindow)
|
||||
})
|
||||
|
||||
val listener = object : ContentManagerListener {
|
||||
override fun contentAdded(event: ContentManagerEvent) {
|
||||
if (UISettings.getInstance().showDirectoryForNonUniqueFilenames) {
|
||||
@@ -55,6 +61,7 @@ class BytecodeToolWindowService(private val project: Project) {
|
||||
// The bytecode tool window cannot be "closed"
|
||||
contentManager.removeContentManagerListener(listener)
|
||||
registeredListeners.remove(toolWindow)
|
||||
messageBusConnection.disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user