mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] fix for invokeMainMenuAction() on each ActionButton click
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ object EventDispatcher {
|
||||
} else {
|
||||
val actionManager = ActionManager.getInstance()
|
||||
val mainActions = (actionManager.getAction(IdeActions.GROUP_MAIN_MENU) as ActionGroup).getFlatIdList()
|
||||
if (mainActions.contains(actionManager.getId(action))) ScriptGenerator.processMainMenuActionEvent(action)
|
||||
if (mainActions.contains(actionManager.getId(action))) ScriptGenerator.processMainMenuActionEvent(action, event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -65,11 +65,12 @@ object ScriptGenerator {
|
||||
addToScript(code)
|
||||
}
|
||||
|
||||
fun processMainMenuActionEvent(action: AnAction) {
|
||||
fun processMainMenuActionEvent(action: AnAction, event: AnActionEvent) {
|
||||
val actionId: String? = ActionManager.getInstance().getId(action)
|
||||
if (actionId == null) {
|
||||
addToScript("//called action (${action.templatePresentation.text}) from main menu with null actionId"); return
|
||||
}
|
||||
if (event.place != "MainMenu") return
|
||||
addToScript(Templates.invokeMainMenuAction(actionId))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user