mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
Rider Main Toolbar: rename from Experimental New Toolbar
GitOrigin-RevId: 7a73ae00a892f49d06f0217233ec3668938ddbdd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0251d770a7
commit
fc7bb4d813
@@ -15961,26 +15961,26 @@ a:com.intellij.ide.navigationToolbar.StructureAwareNavBarModelExtension
|
||||
- processChildren(java.lang.Object,java.lang.Object,com.intellij.util.Processor):Z
|
||||
f:com.intellij.ide.navigationToolbar.StructureAwareNavBarModelExtension$Companion
|
||||
- f:getMODEL():com.intellij.openapi.util.Key
|
||||
com.intellij.ide.navigationToolbar.experimental.ExperimentalToolbarStateListener
|
||||
- sf:Companion:com.intellij.ide.navigationToolbar.experimental.ExperimentalToolbarStateListener$Companion
|
||||
- a:refreshVisibility():V
|
||||
f:com.intellij.ide.navigationToolbar.experimental.ExperimentalToolbarStateListener$Companion
|
||||
- f:getTOPIC():com.intellij.util.messages.Topic
|
||||
c:com.intellij.ide.navigationToolbar.experimental.NewToolbarRootPaneManager
|
||||
c:com.intellij.ide.navigationToolbar.rider.RiderMainToolbarRootPaneManager
|
||||
- com.intellij.openapi.util.SimpleModificationTracker
|
||||
- sf:Companion:com.intellij.ide.navigationToolbar.experimental.NewToolbarRootPaneManager$Companion
|
||||
- sf:Companion:com.intellij.ide.navigationToolbar.rider.RiderMainToolbarRootPaneManager$Companion
|
||||
- <init>(com.intellij.openapi.project.Project):V
|
||||
- isLeftSideAction(com.intellij.openapi.actionSystem.AnAction):Z
|
||||
- isRightSideAction(com.intellij.openapi.actionSystem.AnAction):Z
|
||||
- mainGroupName():java.lang.String
|
||||
- f:startUpdateActionGroups(javax.swing.JPanel):V
|
||||
f:com.intellij.ide.navigationToolbar.experimental.NewToolbarRootPaneManager$Companion
|
||||
- f:getInstance(com.intellij.openapi.project.Project):com.intellij.ide.navigationToolbar.experimental.NewToolbarRootPaneManager
|
||||
f:com.intellij.ide.navigationToolbar.experimental.SearchEverywhereNewToolbarAction
|
||||
f:com.intellij.ide.navigationToolbar.rider.RiderMainToolbarRootPaneManager$Companion
|
||||
- f:getInstance(com.intellij.openapi.project.Project):com.intellij.ide.navigationToolbar.rider.RiderMainToolbarRootPaneManager
|
||||
com.intellij.ide.navigationToolbar.rider.RiderMainToolbarStateListener
|
||||
- sf:Companion:com.intellij.ide.navigationToolbar.rider.RiderMainToolbarStateListener$Companion
|
||||
- a:refreshVisibility():V
|
||||
f:com.intellij.ide.navigationToolbar.rider.RiderMainToolbarStateListener$Companion
|
||||
- f:getTOPIC():com.intellij.util.messages.Topic
|
||||
f:com.intellij.ide.navigationToolbar.rider.SearchEverywhereRiderMainToolbarAction
|
||||
- com.intellij.ide.actions.SearchEverywhereAction
|
||||
- com.intellij.openapi.actionSystem.ex.AnActionListener
|
||||
- com.intellij.openapi.project.DumbAware
|
||||
- sf:Companion:com.intellij.ide.navigationToolbar.experimental.SearchEverywhereNewToolbarAction$Companion
|
||||
- sf:Companion:com.intellij.ide.navigationToolbar.rider.SearchEverywhereRiderMainToolbarAction$Companion
|
||||
- sf:SHOW_HOT_KEY_TIP:java.lang.String
|
||||
- <init>():V
|
||||
- afterActionPerformed(com.intellij.openapi.actionSystem.AnAction,com.intellij.openapi.actionSystem.AnActionEvent,com.intellij.openapi.actionSystem.AnActionResult):V
|
||||
@@ -15989,7 +15989,7 @@ f:com.intellij.ide.navigationToolbar.experimental.SearchEverywhereNewToolbarActi
|
||||
- f:getSeManager():com.intellij.ide.actions.searcheverywhere.SearchEverywhereManager
|
||||
- f:setSeManager(com.intellij.ide.actions.searcheverywhere.SearchEverywhereManager):V
|
||||
- update(com.intellij.openapi.actionSystem.AnActionEvent):V
|
||||
f:com.intellij.ide.navigationToolbar.experimental.SearchEverywhereNewToolbarAction$Companion
|
||||
f:com.intellij.ide.navigationToolbar.rider.SearchEverywhereRiderMainToolbarAction$Companion
|
||||
com.intellij.ide.projectView.HelpID
|
||||
- sf:PROJECT_VIEWS:java.lang.String
|
||||
a:com.intellij.ide.projectView.ProjectView
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.navigationToolbar.experimental
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.navigationToolbar.rider
|
||||
|
||||
import java.awt.BorderLayout
|
||||
import java.awt.Component
|
||||
import java.awt.Container
|
||||
|
||||
internal class NewToolbarBorderLayout : BorderLayout() {
|
||||
/**
|
||||
* Layout for the Rider main toolbar used in the classic IDE UI.
|
||||
*/
|
||||
internal class RiderMainToolbarBorderLayout : BorderLayout() {
|
||||
private var lastTarget: Container? = null
|
||||
|
||||
override fun layoutContainer(target: Container?) {
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.navigationToolbar.experimental
|
||||
package com.intellij.ide.navigationToolbar.rider
|
||||
|
||||
import com.intellij.ide.ui.ToolbarSettings
|
||||
import com.intellij.ide.ui.UISettings
|
||||
@@ -42,11 +42,11 @@ import javax.swing.JComponent
|
||||
import javax.swing.JPanel
|
||||
|
||||
@FunctionalInterface
|
||||
fun interface ExperimentalToolbarStateListener {
|
||||
fun interface RiderMainToolbarStateListener {
|
||||
companion object {
|
||||
@Topic.ProjectLevel
|
||||
val TOPIC: Topic<ExperimentalToolbarStateListener> = Topic(
|
||||
ExperimentalToolbarStateListener::class.java,
|
||||
val TOPIC: Topic<RiderMainToolbarStateListener> = Topic(
|
||||
RiderMainToolbarStateListener::class.java,
|
||||
Topic.BroadcastDirection.NONE,
|
||||
true,
|
||||
)
|
||||
@@ -58,10 +58,12 @@ fun interface ExperimentalToolbarStateListener {
|
||||
fun refreshVisibility()
|
||||
}
|
||||
|
||||
|
||||
open class NewToolbarRootPaneManager(private val project: Project) : SimpleModificationTracker() {
|
||||
/**
|
||||
* This is the Rider main toolbar (available in other IDEs under a registry key), used only in the classic UI.
|
||||
*/
|
||||
open class RiderMainToolbarRootPaneManager(private val project: Project) : SimpleModificationTracker() {
|
||||
companion object {
|
||||
fun getInstance(project: Project): NewToolbarRootPaneManager = project.service()
|
||||
fun getInstance(project: Project): RiderMainToolbarRootPaneManager = project.service()
|
||||
}
|
||||
|
||||
fun startUpdateActionGroups(panel: JPanel) {
|
||||
@@ -89,7 +91,7 @@ open class NewToolbarRootPaneManager(private val project: Project) : SimpleModif
|
||||
}
|
||||
)
|
||||
.exceptionally {
|
||||
logger<NewToolbarRootPaneManager>().error(it)
|
||||
logger<RiderMainToolbarRootPaneManager>().error(it)
|
||||
null
|
||||
}
|
||||
getToolbarGroup()?.let {
|
||||
@@ -193,11 +195,11 @@ private class NewToolbarRootPaneExtension : IdeRootPaneNorthExtension {
|
||||
}
|
||||
|
||||
val panel = MyPanel(project)
|
||||
NewToolbarRootPaneManager.getInstance(project).startUpdateActionGroups(panel)
|
||||
RiderMainToolbarRootPaneManager.getInstance(project).startUpdateActionGroups(panel)
|
||||
return panel
|
||||
}
|
||||
|
||||
private class MyPanel(private val project: Project) : JPanel(NewToolbarBorderLayout()), UISettingsListener {
|
||||
private class MyPanel(private val project: Project) : JPanel(RiderMainToolbarBorderLayout()), UISettingsListener {
|
||||
private var disposable: Disposable? = null
|
||||
|
||||
init {
|
||||
@@ -221,7 +223,7 @@ private class NewToolbarRootPaneExtension : IdeRootPaneNorthExtension {
|
||||
RunWidgetAvailabilityManager.getInstance(project).availabilityChanged.collectLatest {
|
||||
withContext(Dispatchers.EDT) {
|
||||
LOG.info("New toolbar: run widget availability changed $it")
|
||||
NewToolbarRootPaneManager.getInstance(project).startUpdateActionGroups(this@MyPanel)
|
||||
RiderMainToolbarRootPaneManager.getInstance(project).startUpdateActionGroups(this@MyPanel)
|
||||
}
|
||||
}
|
||||
}.cancelOnDispose(disposable)
|
||||
@@ -261,12 +263,12 @@ private class NewToolbarRootPaneExtension : IdeRootPaneNorthExtension {
|
||||
|
||||
isEnabled = isAvailable
|
||||
this.isVisible = isVisible
|
||||
project.messageBus.syncPublisher(ExperimentalToolbarStateListener.TOPIC).refreshVisibility()
|
||||
project.messageBus.syncPublisher(RiderMainToolbarStateListener.TOPIC).refreshVisibility()
|
||||
|
||||
revalidate()
|
||||
repaint()
|
||||
|
||||
NewToolbarRootPaneManager.getInstance(project).startUpdateActionGroups(this)
|
||||
RiderMainToolbarRootPaneManager.getInstance(project).startUpdateActionGroups(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.navigationToolbar.experimental
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.navigationToolbar.rider
|
||||
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.ide.DataManager
|
||||
@@ -44,12 +44,15 @@ import javax.swing.SwingConstants
|
||||
import javax.swing.SwingUtilities
|
||||
import javax.swing.plaf.basic.BasicGraphicsUtils.drawStringUnderlineCharAt
|
||||
|
||||
class SearchEverywhereNewToolbarAction : SearchEverywhereAction(), AnActionListener, DumbAware {
|
||||
/**
|
||||
* Search Everywhere action's item on the main Rider toolbar for the classic UI.
|
||||
*/
|
||||
class SearchEverywhereRiderMainToolbarAction : SearchEverywhereAction(), AnActionListener, DumbAware {
|
||||
companion object {
|
||||
const val SHOW_HOT_KEY_TIP: String = "com.intellij.ide.navigationToolbar.experimental.showSearchEverywhereHotKeyTip"
|
||||
const val SHOW_HOT_KEY_TIP: String = "com.intellij.ide.navigationToolbar.rider.showSearchEverywhereHotKeyTip"
|
||||
}
|
||||
|
||||
private val logger = logger<SearchEverywhereNewToolbarAction>()
|
||||
private val logger = logger<SearchEverywhereRiderMainToolbarAction>()
|
||||
|
||||
private val margin = JBUI.scale(4)
|
||||
private var subscribedForDoubleShift = false
|
||||
@@ -231,7 +234,7 @@ class SearchEverywhereNewToolbarAction : SearchEverywhereAction(), AnActionListe
|
||||
}
|
||||
}
|
||||
}
|
||||
if (action is SearchEverywhereNewToolbarAction && event.place == ActionPlaces.MAIN_TOOLBAR) {
|
||||
if (action is SearchEverywhereRiderMainToolbarAction && event.place == ActionPlaces.MAIN_TOOLBAR) {
|
||||
clearPosition = true
|
||||
}
|
||||
}
|
||||
@@ -689,7 +689,7 @@
|
||||
<lang.elementManipulator forClass="com.intellij.psi.PsiComment"
|
||||
implementationClass="com.intellij.psi.impl.source.resolve.reference.impl.manipulators.PsiCommentManipulator"/>
|
||||
|
||||
<ideRootPaneNorth implementation="com.intellij.ide.navigationToolbar.experimental.NewToolbarRootPaneExtension" order="first"/>
|
||||
<ideRootPaneNorth implementation="com.intellij.ide.navigationToolbar.rider.NewToolbarRootPaneExtension" order="first"/>
|
||||
<navbar implementation="com.intellij.ide.navigationToolbar.DefaultNavBarExtension" id="defaultNavbar" order="last"/>
|
||||
<applicationService serviceInterface="com.intellij.modcommand.ModCommandExecutor"
|
||||
serviceImplementation="com.intellij.lang.impl.modcommand.ModCommandExecutorImpl" overrides="true"/>
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
<projectService serviceInterface="com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater"
|
||||
serviceImplementation="com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl" preload="await"/>
|
||||
|
||||
<projectService serviceImplementation="com.intellij.ide.navigationToolbar.experimental.NewToolbarRootPaneManager"/>
|
||||
<projectService serviceImplementation="com.intellij.ide.navigationToolbar.rider.RiderMainToolbarRootPaneManager"/>
|
||||
|
||||
<idePerformanceListener implementation="com.intellij.diagnostic.IdeaFreezeReporter"/>
|
||||
|
||||
|
||||
@@ -809,7 +809,7 @@
|
||||
<reference id="Back"/>
|
||||
<reference id="Forward"/>
|
||||
<action id="SegmentedVcsControlAction" class="com.intellij.execution.segmentedVcsWidget.SegmentedVcsControlAction"/>
|
||||
<action id="SearchEverywhereNewToolbarAction" class="com.intellij.ide.navigationToolbar.experimental.SearchEverywhereNewToolbarAction"/>
|
||||
<action id="SearchEverywhereNewToolbarAction" class="com.intellij.ide.navigationToolbar.rider.SearchEverywhereRiderMainToolbarAction"/>
|
||||
</group>
|
||||
<group id="RightToolbarSideGroup">
|
||||
<reference id="RunToolbarWidgetAction"/>
|
||||
|
||||
@@ -893,8 +893,8 @@
|
||||
<listener class="git4idea.actions.GitQuickActionsToolbarPopup$MyGitRepositoryListener"
|
||||
topic="com.intellij.dvcs.repo.VcsRepositoryMappingListener"
|
||||
activeInHeadlessMode="false" activeInTestMode="false"/>
|
||||
<listener class="git4idea.ui.branch.GitBranchWidget$MyExperimentalToolbarStateListener"
|
||||
topic="com.intellij.ide.navigationToolbar.experimental.ExperimentalToolbarStateListener"
|
||||
<listener class="git4idea.ui.branch.GitBranchWidget$MyRiderMainToolbarStateListener"
|
||||
topic="com.intellij.ide.navigationToolbar.rider.RiderMainToolbarStateListener"
|
||||
activeInHeadlessMode="false" activeInTestMode="false"/>
|
||||
<listener class="git4idea.ui.branch.GitBranchWidget$SettingsListener"
|
||||
activeInHeadlessMode="false" activeInTestMode="false"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package git4idea.ui.branch
|
||||
|
||||
import com.intellij.dvcs.repo.Repository
|
||||
import com.intellij.dvcs.repo.VcsRepositoryMappingListener
|
||||
import com.intellij.dvcs.ui.DvcsStatusWidget
|
||||
import com.intellij.ide.navigationToolbar.experimental.ExperimentalToolbarStateListener
|
||||
import com.intellij.ide.navigationToolbar.rider.RiderMainToolbarStateListener
|
||||
import com.intellij.ide.ui.ToolbarSettings
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.ide.ui.UISettingsListener
|
||||
@@ -124,7 +124,7 @@ open class GitBranchWidget(project: Project) : DvcsStatusWidget<GitRepository>(p
|
||||
}
|
||||
}
|
||||
|
||||
internal class MyExperimentalToolbarStateListener(private val project: Project) : ExperimentalToolbarStateListener {
|
||||
internal class MyRiderMainToolbarStateListener(private val project: Project) : RiderMainToolbarStateListener {
|
||||
override fun refreshVisibility() {
|
||||
project.getService(StatusBarWidgetsManager::class.java).updateWidget(Factory::class.java)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user