Last active
May 5, 2020 03:58
-
-
Save fc1943s/411540e9e29a1296650bcaa8f9a27eec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.actionSystem.AnActionEvent | |
import static liveplugin.PluginUtil.* | |
import java.awt.* | |
import com.intellij.openapi.wm.ex.* | |
registerAction("FocusFindDialog", "alt shift F") { AnActionEvent event -> | |
def frame = WindowManagerEx.getInstanceEx().getFrame(event.project) | |
frame?.windows.each { Window window -> | |
def className = 'com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog' | |
if (window.class.name != className || window.project != frame.project) { | |
return | |
} | |
def rootPane = window.rootPane | |
def layeredPane = rootPane?.layeredPane | |
def customFrameDialogContent = layeredPane?.getComponent(0) | |
def jPanel1 = customFrameDialogContent?.getComponent(1) | |
def jPanel2 = jPanel1?.getComponent(0) | |
def jPanel3 = jPanel2?.getComponent(0) | |
if(jPanel3?.class?.name == "com.intellij.find.impl.FindPopupPanel"){ | |
window.toFront() | |
} | |
} | |
} | |
if (!isIdeStartup) show("Loaded 'FocusFindDialog' action<br/>Use 'Alt+Shift+F' to run it") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment