How to get run and debug configuration list which didn't exist like "run configuration" popup

see my screencast https://www.youtube.com/watch?v=TidljhHusRY&feature=youtu.be, there is "Ex" in popup, but when i use following, i can't get "Ex"

// Plugin.groovy

 
package ro.test

import com.intellij.execution.RunManager
import com.intellij.execution.impl.RunManagerImpl
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent

/**
* Created by roroco on 4/6/15.
*/
class
Plugin extends AnAction {

    @Override
    void actionPerformed
(AnActionEvent e) {
        RunManagerImpl rm = RunManager.getInstance(e.getProject())
        def l = rm.getConfigurationsList(rm.getConfigurationType("Application"))
        l
    }
}
5 comments
Comment actions Permalink

See the ChooseRunConfigurationPopup.populateWithDynamicRunners() method.

0
Comment actions Permalink

My idea version is 141.178, I didn't see populateWithDynamicRunners, which version will add this method?

0
Comment actions Permalink

This is a private method. Please check its source code, it shows how to accomplish what you need.


0
Comment actions Permalink

I fix, i find the simplest way is following

 
void actionPerformed(AnActionEvent e) {
    super.actionPerformed(e)
    ConfigurationContext ctx = ConfigurationContext.getFromContext(e.dataContext)
    List<ConfigurationFromContext> cfs = PreferredProducerFind.getConfigurationsFromContext(ctx.location, ctx, false)}
0
Comment actions Permalink

By the way, you can use RunManager.getInstance(event.getProject()).setSelectedConfiguration(s) to change default selected configuraiton in toolbar

0

Please sign in to leave a comment.