How to add buttons to the run window?

I would need to add a button to every run window's tool bar (next to the Rerun, Pause, Stop, Close etc. buttons). Inside that button's action, I would also need to find out the command line parameters of the application running in that window. How can I do this?

The purpose is that when the user wants to monitor a misbehaving application (for example take a memory snapshot or start a profiler), he could click a button in the run window which would then open that application in VisualVM.

5 comments
Comment actions Permalink

I have exactly same problem

:)
0
Comment actions Permalink

I haven't tried this myself but I would have a look at the com.intellij.execution.actions.ConsoleActionsPostProcessor extension point (com.intellij.consoleActionsPostProcessor in plugin.xml).

0
Comment actions Permalink

thanks, hopefully I will figure out how to get the ProcessHandler, or some context...

0
Comment actions Permalink

Please try getting RunContentManager.RUN_CONTENT_DESCRIPTOR from the data context - this should help.

0
Comment actions Permalink

thanks, will look at it, but it is still bad solution, because those buttons are for console, and not the tool window.

0

Please sign in to leave a comment.