Getting to RunManager /or Application class

I am trying to write a plugin that provides Run/Debug functionality. Can I get access to the RunManager/Run Configuration? I need to extract information like mainclass/VM args on the selected Entry.

Is there a way to get that information from the API? Right now I managed to parse through the workspace file to extract such information. Is there a better way to do this?

I have a slight problem though. As users change their selection in the entry combobox, the workspace file (both virtual and physical copies are not updated right away). So when my app runs the "selected=true" target, it's the wrong one. If I force an application-level save-all, the workspace file is updated. I want to do this programmatically, but I have a hard time getting a reference to com.intellij.openapi.application.Application. Please tell me how to get a reference to an instance of Application. Thanks!



Not getting much feedback here. Maybe more info may help. I am trying to develope a JProbe plugin for IDEA. The plugin is a project component that looks up the run targets of the current project and pass them off to JProbe for execution/profiling.

But due to the problem mentioned in the previous message, the workspace file does not necessarily represent the current selection state of the run targets. It wouldn't be friendly to prompt the user to select the run target from the list of entries EVERYTIME he/she decides to profile an app.

The solution was to programmatically force an application saveAll to update the workspace file. But I have trouble getting the Application instance from a Project Action. Please help. I would like to have the IntelliJ plugin ready for the coming product release.



Please sign in to leave a comment.