mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RIDER-49001 remove deprecated override in RunToolbarExtraSlotsAction. set RunManager.getInstance(it).selectedConfiguration
GitOrigin-RevId: 5e2c5246bef54ba9a0833bc42452c21106e55d95
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eef3a894a5
commit
59ec55dc4e
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.runToolbar
|
||||
|
||||
import com.intellij.execution.RunManager
|
||||
import com.intellij.execution.RunnerAndConfigurationSettings
|
||||
import com.intellij.execution.executors.ExecutorGroup
|
||||
import com.intellij.execution.runners.ExecutionEnvironment
|
||||
@@ -43,6 +44,9 @@ internal fun AnActionEvent.addWaitingForAProcess(executorId: String) {
|
||||
|
||||
internal fun AnActionEvent.setConfiguration(value: RunnerAndConfigurationSettings?) {
|
||||
runToolbarData()?.configuration = value
|
||||
this.project?.let {
|
||||
RunManager.getInstance(it).selectedConfiguration = value
|
||||
}
|
||||
}
|
||||
|
||||
internal fun AnActionEvent.configuration(): RunnerAndConfigurationSettings? {
|
||||
|
||||
+7
-7
@@ -8,6 +8,7 @@ import com.intellij.openapi.actionSystem.impl.ActionButton
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.ui.popup.JBPopup
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.wm.IdeFrame
|
||||
import com.intellij.ui.awt.RelativePoint
|
||||
import com.intellij.ui.popup.AbstractPopup
|
||||
import com.intellij.ui.popup.ComponentPopupBuilderImpl
|
||||
@@ -21,6 +22,7 @@ import java.awt.Toolkit
|
||||
import java.awt.event.*
|
||||
import java.util.function.Supplier
|
||||
import javax.swing.JComponent
|
||||
import javax.swing.SwingUtilities
|
||||
import javax.swing.event.AncestorEvent
|
||||
import javax.swing.event.AncestorListener
|
||||
|
||||
@@ -44,17 +46,11 @@ class RunToolbarExtraSlotsAction : AnAction(), CustomComponentAction, DumbAware
|
||||
}
|
||||
}
|
||||
|
||||
override fun createCustomComponent(presentation: Presentation, place: String, dataContext: DataContext): JComponent {
|
||||
override fun createCustomComponent(presentation: Presentation, place: String): JComponent {
|
||||
return object : ActionButton(this, presentation, place, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE) {
|
||||
private var popup: JBPopup? = null
|
||||
private var pane: RunToolbarExtraSlotPane? = null
|
||||
|
||||
init {
|
||||
dataContext.getData(CommonDataKeys.PROJECT)?.let {
|
||||
pane = RunToolbarExtraSlotPane(it) { cancel() }
|
||||
}
|
||||
}
|
||||
|
||||
private val t: Int = JBUI.scale(4)
|
||||
fun updateIconImmediately(manager: RunToolbarSlotManager, mainWidget: RunToolbarMainWidgetComponent) {
|
||||
myIcon = when {
|
||||
@@ -71,6 +67,10 @@ class RunToolbarExtraSlotsAction : AnAction(), CustomComponentAction, DumbAware
|
||||
override fun addNotify() {
|
||||
super.addNotify()
|
||||
|
||||
(SwingUtilities.getWindowAncestor(this) as? IdeFrame)?.project?.let {
|
||||
pane = RunToolbarExtraSlotPane(it) { cancel() }
|
||||
}
|
||||
|
||||
mousePosition?.let {
|
||||
val bounds = this.bounds
|
||||
bounds.location = Point(0, 0)
|
||||
|
||||
Reference in New Issue
Block a user