Search in sources :

Example 1 with CloudDebugRunConfiguration

use of com.google.cloud.tools.intellij.debugger.CloudDebugRunConfiguration in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardWebIntegration method setupDebugRunConfiguration.

private void setupDebugRunConfiguration(@NotNull Project project) {
    RunManager runManager = RunManager.getInstance(project);
    boolean hasExistingDebugConfiguration = runManager.getAllConfigurationsList().stream().anyMatch(config -> config instanceof CloudDebugRunConfiguration);
    if (!hasExistingDebugConfiguration) {
        CloudDebugConfigType debugConfigType = CloudDebugConfigType.getInstance();
        ConfigurationFactory factory = debugConfigType.getConfigurationFactories()[0];
        RunnerAndConfigurationSettings settings = runManager.createConfiguration(new CloudDebugRunConfiguration(project, factory).clone(), factory);
        runManager.addConfiguration(settings, false);
    }
}
Also used : CloudDebugRunConfiguration(com.google.cloud.tools.intellij.debugger.CloudDebugRunConfiguration) CloudDebugConfigType(com.google.cloud.tools.intellij.debugger.CloudDebugConfigType) ConfigurationFactory(com.intellij.execution.configurations.ConfigurationFactory) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RunManager(com.intellij.execution.RunManager)

Example 2 with CloudDebugRunConfiguration

use of com.google.cloud.tools.intellij.debugger.CloudDebugRunConfiguration in project google-cloud-intellij by GoogleCloudPlatform.

the class ToggleSnapshotLocationAction method update.

@Override
public void update(AnActionEvent event) {
    Editor editor = EDITOR.getData(event.getDataContext());
    if (editor == null) {
        return;
    }
    RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(editor.getProject());
    for (RunConfiguration runConfiguration : runManager.getAllConfigurations()) {
        if (runConfiguration instanceof CloudDebugRunConfiguration) {
            event.getPresentation().setVisible(true);
            return;
        }
    }
    event.getPresentation().setVisible(false);
}
Also used : RunConfiguration(com.intellij.execution.configurations.RunConfiguration) CloudDebugRunConfiguration(com.google.cloud.tools.intellij.debugger.CloudDebugRunConfiguration) CloudDebugRunConfiguration(com.google.cloud.tools.intellij.debugger.CloudDebugRunConfiguration) Editor(com.intellij.openapi.editor.Editor) RunManagerImpl(com.intellij.execution.impl.RunManagerImpl)

Aggregations

CloudDebugRunConfiguration (com.google.cloud.tools.intellij.debugger.CloudDebugRunConfiguration)2 CloudDebugConfigType (com.google.cloud.tools.intellij.debugger.CloudDebugConfigType)1 RunManager (com.intellij.execution.RunManager)1 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)1 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)1 RunManagerImpl (com.intellij.execution.impl.RunManagerImpl)1 Editor (com.intellij.openapi.editor.Editor)1