given a Module, find the Project window

I'd like to pop up a modal dialog from within JUnitPatcher.patchJavaParameters(), which provides a Module but not the AnActionEvent. The dialog should have the Project's window as its owner. Is there some way to find out the current project window (if any), given a Module?

1 comment
Comment actions Permalink

Hello Brian,

I'd like to pop up a modal dialog from within
JUnitPatcher.patchJavaParameters(), which provides a Module but not
the AnActionEvent. The dialog should have the Project's window as its
owner. Is there some way to find out the current project window (if
any), given a Module?


Most of IDEA's dialogs (including DialogWrapper and dialogs from the Messages
class) can accept a Project as the owner window, and you can use Module.getProject()
to get one.

There's an API for getting a window by a project too (something like WindowManager.suggestParentWindow()),
but using our APIs for showing dialogs is preferable.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.