Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fc1943s/411540e9e29a1296650bcaa8f9a27eec to your computer and use it in GitHub Desktop.
Save fc1943s/411540e9e29a1296650bcaa8f9a27eec to your computer and use it in GitHub Desktop.
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