Search in sources :

Example 1 with RunManager

use of com.intellij.execution.RunManager in project intellij-community by JetBrains.

the class CreateAction method choosePolicy.

private static BaseCreatePolicy choosePolicy(final ConfigurationContext context) {
    final RunnerAndConfigurationSettings configuration = context.findExisting();
    if (configuration == null)
        return CREATE_AND_EDIT;
    final RunManager runManager = context.getRunManager();
    if (runManager.getSelectedConfiguration() != configuration)
        return SELECT;
    if (configuration.isTemporary())
        return SAVE;
    return SELECTED_STABLE;
}
Also used : RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RunManager(com.intellij.execution.RunManager)

Example 2 with RunManager

use of com.intellij.execution.RunManager in project intellij-community by JetBrains.

the class PluginModuleBuilder method commitModule.

@Nullable
@Override
public Module commitModule(@NotNull Project project, @Nullable ModifiableModuleModel model) {
    Module module = super.commitModule(project, model);
    if (module != null) {
        RunManager runManager = RunManager.getInstance(project);
        RunnerAndConfigurationSettings configuration = runManager.createRunConfiguration(DevKitBundle.message("run.configuration.title"), new PluginConfigurationType().getConfigurationFactories()[0]);
        runManager.addConfiguration(configuration, false);
        runManager.setSelectedConfiguration(configuration);
    }
    return module;
}
Also used : RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) PluginConfigurationType(org.jetbrains.idea.devkit.run.PluginConfigurationType) RunManager(com.intellij.execution.RunManager) Nullable(org.jetbrains.annotations.Nullable)

Example 3 with RunManager

use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.

the class FlexMoveTest method testConfigUpdatedOnPackageMove.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnPackageMove() throws Exception {
    FlexTestUtils.modifyBuildConfiguration(myModule, bc -> bc.setMainClass("foo.SomeClass"));
    final RunManager runManager = RunManager.getInstance(myProject);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.SomeClass", "testSomething", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.SomeClass", "", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "foo", myModule, FlexUnitRunnerParameters.Scope.Package, "foo", "", "", true);
    FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.SomeClass", true);
    doTest("foo", "bar");
    assertEquals("bar.foo.SomeClass", FlexBuildConfigurationManager.getInstance(myModule).getActiveConfiguration().getMainClass());
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass.testSomething()", "", "bar.foo.SomeClass", "testSomething");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass", "", "bar.foo.SomeClass", "");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "bar.foo", "bar.foo", "", "");
    FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "bar.foo.SomeClass");
}
Also used : RunManager(com.intellij.execution.RunManager) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 4 with RunManager

use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.

the class FlexMoveTest method testConfigUpdatedOnClassMove.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnClassMove() throws Exception {
    final RunManager runManager = RunManager.getInstance(myProject);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.bar.SomeClass", "testSomething", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.bar.SomeClass", "", true);
    FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass", true);
    doTest("foo/bar/SomeClass.mxml", "");
    //assertEquals("SomeClass", config.MAIN_CLASS);
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass.testSomething()", "", "SomeClass", "testSomething");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass", "", "SomeClass", "");
    FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "SomeClass");
}
Also used : RunManager(com.intellij.execution.RunManager) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 5 with RunManager

use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.

the class FlexRenameTest method testConfigUpdatedOnClassRename.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnClassRename() throws Exception {
    FlexTestUtils.modifyBuildConfiguration(myModule, bc -> bc.setMainClass("foo.bar.SomeClass"));
    final RunManager runManager = RunManager.getInstance(myProject);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "Own name", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.bar.SomeClass", "testSomething", false);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.bar.SomeClass", "", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "Same class short name", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.SomeClass", "", false);
    FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass", true);
    doTest("Renamed", "as");
    assertEquals("foo.bar.Renamed", FlexBuildConfigurationManager.getInstance(myModule).getActiveConfiguration().getMainClass());
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "Own name", "", "foo.bar.Renamed", "testSomething");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "Renamed", "", "foo.bar.Renamed", "");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "Same class short name", "", "foo.SomeClass", "");
    FlexTestUtils.checkFlashRunConfig(runManager, myModule, "Renamed", "foo.bar.Renamed");
}
Also used : RunManager(com.intellij.execution.RunManager)

Aggregations

RunManager (com.intellij.execution.RunManager)18 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)11 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)3 Nullable (org.jetbrains.annotations.Nullable)3 JSTestOptions (com.intellij.lang.javascript.JSTestOptions)2 Project (com.intellij.openapi.project.Project)2 NotNull (org.jetbrains.annotations.NotNull)2 AndroidRunConfiguration (com.android.tools.idea.run.AndroidRunConfiguration)1 AndroidRunConfigurationBase (com.android.tools.idea.run.AndroidRunConfigurationBase)1 AndroidRunConfigurationType (com.android.tools.idea.run.AndroidRunConfigurationType)1 TargetSelectionMode (com.android.tools.idea.run.TargetSelectionMode)1 PhoneGapConfigurationType (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapConfigurationType)1 PhoneGapRunConfiguration (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapRunConfiguration)1 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)1 ConfigurationType (com.intellij.execution.configurations.ConfigurationType)1 WebBrowser (com.intellij.ide.browsers.WebBrowser)1 UsageDescriptor (com.intellij.internal.statistic.beans.UsageDescriptor)1 JavaScriptDebugConfiguration (com.intellij.javascript.debugger.execution.JavaScriptDebugConfiguration)1 PreferableRunConfiguration (com.intellij.javascript.testFramework.PreferableRunConfiguration)1 FlashRunConfiguration (com.intellij.lang.javascript.flex.run.FlashRunConfiguration)1