From 2e6cd387a9684ac843c8d659cdaff6d48c84dc09 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Mon, 11 Mar 2024 19:02:15 +0100 Subject: [PATCH] remove unused `NavBarItemPresentation.selectedTextAttributes` GitOrigin-RevId: 158ec0d0cb8f038105458767e9adfd98bc6b12d2 --- .../execution/services/ServiceViewNavBarPanel.kt | 4 ++-- .../intellij/ide/navbar/NavBarItemPresentation.kt | 8 -------- .../intellij/ide/navbar/impl/DefaultNavBarItem.kt | 14 ++++++-------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/services/ServiceViewNavBarPanel.kt b/platform/lang-impl/src/com/intellij/execution/services/ServiceViewNavBarPanel.kt index bc3892b2436d..4ddc14b33a06 100644 --- a/platform/lang-impl/src/com/intellij/execution/services/ServiceViewNavBarPanel.kt +++ b/platform/lang-impl/src/com/intellij/execution/services/ServiceViewNavBarPanel.kt @@ -137,7 +137,7 @@ internal class ServiceViewRootNavBarItem( override val presentation: NavBarItemPresentation = NavBarItemPresentation( AllIcons.Nodes.Services, "", null, REGULAR_ATTRIBUTES, - REGULAR_ATTRIBUTES, false + false ) override suspend fun children(): List { @@ -170,7 +170,7 @@ private class ServiceViewNavBarItem( override val presentation: NavBarItemPresentation = run { val icon = item.getViewDescriptor().getPresentation().getIcon(false) val text = ServiceViewDragHelper.getDisplayName(item.getViewDescriptor().getPresentation()) - NavBarItemPresentation(icon, text, null, REGULAR_ATTRIBUTES, REGULAR_ATTRIBUTES, false) + NavBarItemPresentation(icon, text, null, REGULAR_ATTRIBUTES, false) } override suspend fun children(): List { diff --git a/platform/lang-impl/src/com/intellij/ide/navbar/NavBarItemPresentation.kt b/platform/lang-impl/src/com/intellij/ide/navbar/NavBarItemPresentation.kt index f3d9236d5051..36844ea22f8a 100644 --- a/platform/lang-impl/src/com/intellij/ide/navbar/NavBarItemPresentation.kt +++ b/platform/lang-impl/src/com/intellij/ide/navbar/NavBarItemPresentation.kt @@ -2,7 +2,6 @@ package com.intellij.ide.navbar import com.intellij.ui.SimpleTextAttributes -import org.jetbrains.annotations.ApiStatus import org.jetbrains.annotations.Nls import javax.swing.Icon @@ -31,13 +30,6 @@ class NavBarItemPresentation( */ val textAttributes: SimpleTextAttributes, - /** - * Not used, tobe deleted - */ - @ApiStatus.ScheduledForRemoval - @Deprecated("not used, to be deleted") - val selectedTextAttributes: SimpleTextAttributes, - /** * Find better place for that. * Currently used as one more criteria to show item's icon diff --git a/platform/lang-impl/src/com/intellij/ide/navbar/impl/DefaultNavBarItem.kt b/platform/lang-impl/src/com/intellij/ide/navbar/impl/DefaultNavBarItem.kt index f3a777eced17..9174b176bd27 100644 --- a/platform/lang-impl/src/com/intellij/ide/navbar/impl/DefaultNavBarItem.kt +++ b/platform/lang-impl/src/com/intellij/ide/navbar/impl/DefaultNavBarItem.kt @@ -58,8 +58,7 @@ open class DefaultNavBarItem(val data: T) : NavBarItem { val text: String = fromOldExtensions { ext -> ext.getPresentableText(data, false) } ?: getText(false) val popupText: String = fromOldExtensions { ext -> ext.getPresentableText(data, true) } ?: getText(true) - val textAttributes = getTextAttributes(selected = false) - val selectedTextAttributes = getTextAttributes(selected = true) + val textAttributes = getTextAttributes() val hasContainingFile = (data as? PsiElement)?.containingFile != null @@ -68,7 +67,6 @@ open class DefaultNavBarItem(val data: T) : NavBarItem { text, popupText, textAttributes, - selectedTextAttributes, hasContainingFile ) } @@ -77,7 +75,7 @@ open class DefaultNavBarItem(val data: T) : NavBarItem { open fun getText(forPopup: Boolean): @Nls String = data.toString() - open fun getTextAttributes(selected: Boolean): SimpleTextAttributes = REGULAR_ATTRIBUTES + open fun getTextAttributes(): SimpleTextAttributes = REGULAR_ATTRIBUTES } @@ -90,7 +88,7 @@ internal class ProjectNavBarItem(data: Project) : DefaultNavBarItem(dat override fun getIcon(): Icon = AllIcons.Nodes.Project - override fun getTextAttributes(selected: Boolean): SimpleTextAttributes { + override fun getTextAttributes(): SimpleTextAttributes { val problemSolver = WolfTheProblemSolver.getInstanceIfCreated(data) ?: return REGULAR_ATTRIBUTES val hasProblems = ModuleManager.getInstance(data) .modules @@ -122,7 +120,7 @@ internal class ModuleNavBarItem(data: Module) : DefaultNavBarItem(data), override fun getIcon(): Icon = ModuleType.get(data).icon - override fun getTextAttributes(selected: Boolean): SimpleTextAttributes { + override fun getTextAttributes(): SimpleTextAttributes { val problemSolver = WolfTheProblemSolver.getInstance(data.project) val hasProblems = problemSolver.hasProblemFilesBeneath(data) @@ -159,14 +157,14 @@ internal class PsiNavBarItem(data: PsiElement, val ownerExtension: NavBarModelEx null } - override fun getTextAttributes(selected: Boolean): SimpleTextAttributes { + override fun getTextAttributes(): SimpleTextAttributes { val psiFile = data.containingFile if (psiFile != null) { val virtualFile = psiFile.virtualFile ?: return SimpleTextAttributes(null, null, navBarErrorAttributes.waveColor, STYLE_PLAIN) val problemSolver = WolfTheProblemSolver.getInstance(data.project) val style = if (problemSolver.isProblemFile(virtualFile)) navBarErrorAttributes.style else STYLE_PLAIN - val color = if (!selected) FileStatusManager.getInstance(data.project).getStatus(virtualFile).color else null + val color = FileStatusManager.getInstance(data.project).getStatus(virtualFile).color return SimpleTextAttributes(null, color, navBarErrorAttributes.waveColor, style) } else {