How to pause an action in onActionPerformed to wait for another action's completion?

Answered

I want to implement such a feature. When an action is being performed, it will first check if some configs are missing. If so, it will pause to trigger another action and wait for its completion to resume.

It is just like hitting run action without selecting any config, a popup menu will trigger to let the user select.

0
3 comments

Do you show any UI? What should it look like? Do you mean to invoke another AnAction programatically from the one being called?

1
Avatar
Permanently deleted user

Yes. To be more specify. Let me call it Action1 and Action2. Action1 will first check if a setting has been configured. If not, it will trigger Action2 to open a popup menu and let the user select. After that, Action1 will continue to perform.

0

A common approach is to extract the "business code" from Action2 into method that can be called directly from Action1, e.g. making it a public static method in Action2 or extracting it into separate class.

0

Please sign in to leave a comment.