本文整理汇总了Java中com.intellij.execution.actions.RunConfigurationProducer.createConfigurationFromContext方法的典型用法代码示例。如果您正苦于以下问题:Java RunConfigurationProducer.createConfigurationFromContext方法的具体用法?Java RunConfigurationProducer.createConfigurationFromContext怎么用?Java RunConfigurationProducer.createConfigurationFromContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.actions.RunConfigurationProducer
的用法示例。
在下文中一共展示了RunConfigurationProducer.createConfigurationFromContext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRunConfigurationFromContext
import com.intellij.execution.actions.RunConfigurationProducer; //导入方法依赖的package包/类
/**
* Creates run configuration from right click menu
*
* @param fixture test fixture
* @param expectedClass expected class of run configuration
* @param <C> expected class of run configuration
* @return configuration (if created) or null (otherwise)
*/
@Nullable
public static <C extends RunConfiguration> C createRunConfigurationFromContext(
@NotNull final CodeInsightTestFixture fixture,
@NotNull final Class<C> expectedClass) {
final DataContext context = DataManager.getInstance().getDataContext(fixture.getEditor().getComponent());
for (final RunConfigurationProducer<?> producer : RunConfigurationProducer.EP_NAME.getExtensions()) {
final ConfigurationFromContext fromContext = producer.createConfigurationFromContext(ConfigurationContext.getFromContext(context));
if (fromContext == null) {
continue;
}
final C result = PyUtil.as(fromContext.getConfiguration(), expectedClass);
if (result != null) {
return result;
}
}
return null;
}
示例2: getPantsJunitConfigurationFromContext
import com.intellij.execution.actions.RunConfigurationProducer; //导入方法依赖的package包/类
private ConfigurationFromContext getPantsJunitConfigurationFromContext(ConfigurationContext context) {
assertNotNull(context);
List<RunConfigurationProducer<?>> producers = RunConfigurationProducer.getProducers(myProject);
assertTrue(producers.size() > 0);
for (RunConfigurationProducer producer : producers) {
if (producer instanceof PantsJUnitTestRunConfigurationProducer) {
return producer.createConfigurationFromContext(context);
}
}
return null;
}
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:12,代码来源:OSSPantsJvmRunConfigurationIntegrationTest.java
示例3: getPantsPytestConfigurationFromContext
import com.intellij.execution.actions.RunConfigurationProducer; //导入方法依赖的package包/类
private ConfigurationFromContext getPantsPytestConfigurationFromContext(ConfigurationContext context) {
for (RunConfigurationProducer producer : RunConfigurationProducer.getProducers(myProject)) {
if (producer instanceof PantsPythonTestRunConfigurationProducer) {
return producer.createConfigurationFromContext(context);
}
}
return null;
}
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:9,代码来源:OSSPantsPythonRunConfigurationIntegrationTest.java