本文整理汇总了Java中com.intellij.execution.configurations.ModuleBasedConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java ModuleBasedConfiguration类的具体用法?Java ModuleBasedConfiguration怎么用?Java ModuleBasedConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleBasedConfiguration类属于com.intellij.execution.configurations包,在下文中一共展示了ModuleBasedConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeConfiguration
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
public void executeConfiguration(Project project, ModuleBasedConfiguration appCon) {
if (noProjectsAreOpen()) {
logger.warn("No open projects found, can't execute the project.");
return;
}
logger.info("Starting to build execution environment.");
RunManager runManager = RunManager.getInstance(project);
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
RunnerAndConfigurationSettingsImpl selectedConfiguration =
getApplicationRunnerAndConfigurationSettings(runManager, appCon);
ProgramRunner runner = getRunner(executor, selectedConfiguration);
logger.info("Creating ExecutionEnvironment.");
ExecutionEnvironment environment =
new ExecutionEnvironment(
new DefaultRunExecutor(), runner, selectedConfiguration, project);
try {
logger.info("Executing project.");
runner.execute(environment);
} catch (ExecutionException e1) {
JavaExecutionUtil.showExecutionErrorMessage(e1, "Error", project);
}
}
示例2: setupConfigurationModule
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
protected boolean setupConfigurationModule(@Nullable ConfigurationContext context, ModuleBasedConfiguration configuration) {
if (context != null) {
final RunnerAndConfigurationSettings template =
((RunManagerImpl)context.getRunManager()).getConfigurationTemplate(getConfigurationFactory());
final Module contextModule = context.getModule();
final Module predefinedModule = ((ModuleBasedConfiguration)template.getConfiguration()).getConfigurationModule().getModule();
if (predefinedModule != null) {
configuration.setModule(predefinedModule);
return true;
}
final Module module = findModule(configuration, contextModule);
if (module != null) {
configuration.setModule(module);
return true;
}
}
return false;
}
示例3: getCurrentCoverageSuite
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
@Nullable
private CoverageSuitesBundle getCurrentCoverageSuite() {
if (myModel == null) {
return null;
}
final RunProfile runConf = myModel.getProperties().getConfiguration();
if (runConf instanceof ModuleBasedConfiguration) {
// if coverage supported for run configuration
if (CoverageEnabledConfiguration.isApplicableTo((ModuleBasedConfiguration) runConf)) {
// Get coverage settings
Executor executor = myProperties.getExecutor();
if (executor != null && executor.getId().equals(CoverageExecutor.EXECUTOR_ID)) {
return CoverageDataManager.getInstance(myProperties.getProject()).getCurrentSuitesBundle();
}
}
}
return null;
}
示例4: setupRootModel
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
@Override
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
setJavaRootModel(rootModel);
Project project = rootModel.getProject();
RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project);
//Create "Run dub" configuration
RunnerAndConfigurationSettings runDubSettings = runManager.findConfigurationByName(RUN_DUB_CONFIG_NAME);
if(runDubSettings == null) {
final DLangRunDubConfigurationType configurationType
= Extensions.findExtension(ConfigurationType.CONFIGURATION_TYPE_EP, DLangRunDubConfigurationType.class);
final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
runDubSettings = runManager.createRunConfiguration(RUN_DUB_CONFIG_NAME, factory);
((ModuleBasedConfiguration) runDubSettings.getConfiguration()).setModule(rootModel.getModule());
runManager.addConfiguration(runDubSettings, false);
}
}
示例5: run
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
private static ProcessingItem[] run(CompileContext context,
ProcessingItem[] items,
ModuleBasedConfiguration configuration) {
final Module module = configuration.getConfigurationModule().getModule();
if (module == null) {
context.addMessage(CompilerMessageCategory.ERROR,
HaxeBundle.message("no.module.for.run.configuration", configuration.getName()), null, -1, -1);
return ProcessingItem.EMPTY_ARRAY;
}
HaxeCommonCompilerUtil.CompilationContext compilationContext = createCompilationContext(context, module, configuration);
if (compileModule(context, module, compilationContext)) {
final int index = findProcessingItemIndexByModule(items, configuration.getConfigurationModule());
if (index != -1) {
return new ProcessingItem[]{items[index]};
}
}
return ProcessingItem.EMPTY_ARRAY;
}
示例6: getCurrentCoverageSuite
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
@javax.annotation.Nullable
private CoverageSuitesBundle getCurrentCoverageSuite() {
if (myModel == null) {
return null;
}
final RunProfile runConf = myModel.getProperties().getConfiguration();
if (runConf instanceof ModuleBasedConfiguration) {
// if coverage supported for run configuration
if (CoverageEnabledConfiguration.isApplicableTo((ModuleBasedConfiguration) runConf)) {
// Get coverage settings
Executor executor = myProperties.getExecutor();
if (executor != null && executor.getId().equals(CoverageExecutor.EXECUTOR_ID)) {
return CoverageDataManager.getInstance(myProperties.getProject()).getCurrentSuitesBundle();
}
}
}
return null;
}
示例7: getApplicationRunnerAndConfigurationSettings
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
@NotNull
private RunnerAndConfigurationSettingsImpl getApplicationRunnerAndConfigurationSettings(
RunManager runManager, ModuleBasedConfiguration appCon) {
logger.info("Getting RunnerAndConfigurationSettings implementation.");
return new RunnerAndConfigurationSettingsImpl(
(RunManagerImpl) runManager,
appCon,
runManager.getSelectedConfiguration().isTemplate());
}
示例8: setupPackageConfiguration
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
protected TestSearchScope setupPackageConfiguration(ConfigurationContext context, Project project, ModuleBasedConfiguration configuration, TestSearchScope scope) {
if (scope != TestSearchScope.WHOLE_PROJECT) {
if (!setupConfigurationModule(context, configuration)) {
return TestSearchScope.WHOLE_PROJECT;
}
}
return scope;
}
示例9: ResetConfigurationModuleAdapter
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
public ResetConfigurationModuleAdapter(ModuleBasedConfiguration configuration, final Project project,
final boolean isDebug,
final ToolWindowManager toolWindowManager,
final String testRunDebugId) {
myProject = project;
myIsDebug = isDebug;
myToolWindowManager = toolWindowManager;
myTestRunDebugId = testRunDebugId;
myConfiguration = configuration;
}
示例10: findModule
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
public Module findModule(ModuleBasedConfiguration configuration, Module contextModule, Set<String> patterns) {
return JavaExecutionUtil.findModule(contextModule, patterns, configuration.getProject(), new Condition<PsiClass>() {
@Override
public boolean value(PsiClass psiClass) {
return isTestClass(psiClass);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AbstractPatternBasedConfigurationProducer.java
示例11: reset
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
public void reset(final ModuleBasedConfiguration configuration) {
final Module[] modules = ModuleManager.getInstance(getProject()).getModules();
final List<Module> list = new ArrayList<Module>();
for (final Module module : modules) {
if (isModuleAccepted(module)) list.add(module);
}
setModules(list);
myModulesList.setSelectedItem(configuration.getConfigurationModule().getModule());
}
示例12: isModuleJre50Configured
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
public boolean isModuleJre50Configured(final ModuleBasedConfiguration configuration) {
final Module module = configuration.getConfigurationModule().getModule();
if (module != null && !module.isDisposed()) {
return isJre50(ModuleRootManager.getInstance(module).getSdk());
}
return isJre50(ProjectRootManager.getInstance(configuration.getProject()).getProjectSdk());
}
示例13: fixModuleName
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
private void fixModuleName(Module module) {
List<RunConfiguration> configurations = RunManager.getInstance(module.getProject()).getAllConfigurationsList();
for (RunConfiguration configuration : configurations) {
if (configuration instanceof ModuleBasedConfiguration) {
((ModuleBasedConfiguration)configuration).getConfigurationModule().setModule(module);
}
}
ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel();
for (WizardInputField field : myAdditionalFields) {
ProjectTemplateParameterFactory factory = WizardInputField.getFactoryById(field.getId());
factory.applyResult(field.getValue(), model);
}
model.commit();
}
示例14: getModule
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
@Nullable
protected Module getModule(CommonProgramRunConfigurationParameters configuration) {
if (configuration instanceof ModuleBasedConfiguration) {
return ((ModuleBasedConfiguration)configuration).getConfigurationModule().getModule();
}
return null;
}
示例15: createConfigurationSettings
import com.intellij.execution.configurations.ModuleBasedConfiguration; //导入依赖的package包/类
private static RunnerAndConfigurationSettings createConfigurationSettings(ConfigurationFactory factory, @NotNull final Module module) {
final RunnerAndConfigurationSettings settings =
RunManager.getInstance(module.getProject()).createRunConfiguration(module.getName(), factory);
ModuleBasedConfiguration configuration = (ModuleBasedConfiguration) settings.getConfiguration();
configuration.setModule(module);
return settings;
}