mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Recent Tests] install actions on next popup
This commit is contained in:
@@ -22,6 +22,7 @@ import com.intellij.openapi.ui.popup.PopupStep
|
||||
import com.intellij.openapi.ui.popup.util.BaseListPopupStep
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.ui.popup.WizardPopup
|
||||
import com.intellij.ui.popup.list.ListPopupImpl
|
||||
import com.intellij.util.PsiNavigateUtil
|
||||
import java.awt.event.ActionEvent
|
||||
@@ -42,15 +43,29 @@ class RecentTestsListPopup(popupStep: ListPopupStep<RecentTestsPopupEntry>,
|
||||
setAdText("Debug with $shift, navigate with F4")
|
||||
}
|
||||
|
||||
private fun registerActions(popup: ListPopupImpl) {
|
||||
override fun createPopup(parent: WizardPopup?, step: PopupStep<*>?, parentValue: Any?): WizardPopup {
|
||||
val popup = super.createPopup(parent, step, parentValue)
|
||||
registerActions(popup)
|
||||
return popup
|
||||
}
|
||||
|
||||
private fun registerActions(popup: WizardPopup) {
|
||||
popup.registerAction("alternate", KeyStroke.getKeyStroke("shift pressed SHIFT"), object : AbstractAction() {
|
||||
override fun actionPerformed(e: ActionEvent) = shiftPressed()
|
||||
override fun actionPerformed(e: ActionEvent) {
|
||||
shiftPressed()
|
||||
}
|
||||
})
|
||||
|
||||
popup.registerAction("restoreDefault", KeyStroke.getKeyStroke("released SHIFT"), object : AbstractAction() {
|
||||
override fun actionPerformed(e: ActionEvent) = shiftReleased()
|
||||
override fun actionPerformed(e: ActionEvent) {
|
||||
shiftReleased()
|
||||
}
|
||||
})
|
||||
|
||||
popup.registerAction("invokeAction", KeyStroke.getKeyStroke("shift ENTER"), object : AbstractAction() {
|
||||
override fun actionPerformed(e: ActionEvent) = handleSelect(true)
|
||||
override fun actionPerformed(e: ActionEvent) {
|
||||
handleSelect(true)
|
||||
}
|
||||
})
|
||||
|
||||
popup.registerAction("navigate", KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0), object : AbstractAction() {
|
||||
|
||||
Reference in New Issue
Block a user