本文整理汇总了Java中com.intellij.execution.impl.RunManagerImpl类的典型用法代码示例。如果您正苦于以下问题:Java RunManagerImpl类的具体用法?Java RunManagerImpl怎么用?Java RunManagerImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RunManagerImpl类属于com.intellij.execution.impl包,在下文中一共展示了RunManagerImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRemoteDebug
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
private void createRemoteDebug(
final RunManagerImpl runManager,
final HybrisProjectDescriptor hybrisProjectDescriptor
) {
final RemoteConfigurationType remoteConfigurationType = ConfigurationTypeUtil.findConfigurationType(
RemoteConfigurationType.class);
final ConfigurationFactory configurationFactory = remoteConfigurationType.getConfigurationFactories()[0];
final String debugName = HybrisI18NBundleUtils.message("hybris.project.import.run.configuration.remote.debug");
final RunnerAndConfigurationSettings runner = runManager.createRunConfiguration(
debugName,
configurationFactory
);
final RemoteConfiguration remoteConfiguration = (RemoteConfiguration) runner.getConfiguration();
remoteConfiguration.PORT = getDebugPort(hybrisProjectDescriptor);
ApplicationManager.getApplication().invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
runner.setSingleton(true);
runner.setActivateToolWindowBeforeRun(true);
runManager.addConfiguration(runner, true);
runManager.setSelectedConfiguration(runner);
}));
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:23,代码来源:DebugRunConfigurationConfigurator.java
示例2: setupConfigurationModule
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的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: getTarget
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
public ExecutionTarget getTarget() {
if (myTargetId != null) {
if (DefaultExecutionTarget.INSTANCE.getId().equals(myTargetId)) {
return DefaultExecutionTarget.INSTANCE;
}
final RunnerAndConfigurationSettingsImpl settings =
new RunnerAndConfigurationSettingsImpl(RunManagerImpl.getInstanceImpl(myProject), myConfiguration, false);
for (ExecutionTargetProvider provider : Extensions.getExtensions(ExecutionTargetProvider.EXTENSION_NAME)) {
for (ExecutionTarget target : provider.getTargets(myProject, settings)) {
if (myTargetId.equals(target.getId())) {
return target;
}
}
}
return null;
}
return DefaultExecutionTarget.INSTANCE;
}
示例4: getConfigurations
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
private Collection<RunnerAndConfigurationSettings> getConfigurations(ProjectStartupConfigurationBase configuration) {
if (configuration.isEmpty()) return Collections.emptyList();
final List<RunnerAndConfigurationSettings> result = new ArrayList<RunnerAndConfigurationSettings>();
final List<ProjectStartupConfigurationBase.ConfigurationDescriptor> list = configuration.getList();
for (ProjectStartupConfigurationBase.ConfigurationDescriptor descriptor : list) {
final RunnerAndConfigurationSettings settings = ((RunManagerImpl) myRunManager).getConfigurationById(descriptor.getId());
if (settings != null && settings.getName().equals(descriptor.getName())) {
result.add(settings);
} else {
NOTIFICATION_GROUP.createNotification(PREFIX + " Run Configuration '" + descriptor.getName() + "' not found, removed from list.",
MessageType.WARNING).notify(myProject);
}
}
return result;
}
示例5: addConfigurations
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
private void addConfigurations() {
RunManagerImpl runManager = (RunManagerImpl) RunManagerEx.getInstanceEx(project);
BlazeCommandRunConfigurationType.BlazeCommandRunConfigurationFactory configurationFactory =
BlazeCommandRunConfigurationType.getInstance().getFactory();
BlazeCommandRunConfiguration blazeAndroidBinaryConfiguration =
configurationFactory.createTemplateConfiguration(project);
blazeAndroidBinaryConfiguration.setName("AndroidBinaryConfiguration");
blazeAndroidBinaryConfiguration.setTarget(Label.create("//label:android_binary_rule"));
BlazeCommandRunConfiguration blazeAndroidTestConfiguration =
configurationFactory.createTemplateConfiguration(project);
blazeAndroidTestConfiguration.setName("AndroidTestConfiguration");
blazeAndroidTestConfiguration.setTarget(Label.create("//label:android_test_rule"));
runManager.addConfiguration(
runManager.createConfiguration(blazeAndroidBinaryConfiguration, configurationFactory),
true);
runManager.addConfiguration(
runManager.createConfiguration(blazeAndroidTestConfiguration, configurationFactory), true);
}
示例6: stopApplication
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
/**
* Stops the applications via the descriptor of configuration. This gets called when the application finishes on the client side without maniually closing it.
*
* @param javaExitCode
*/
public void stopApplication(@NotNull int javaExitCode) {
final RunManagerImpl runManager = (RunManagerImpl) RunManager.getInstance(project);
final Collection<RunnerAndConfigurationSettings> allConfigurations = runManager.getSortedConfigurations();
List<RunContentDescriptor> allDescriptors = ExecutionManager.getInstance(project).getContentManager().getAllDescriptors();
boolean exitMsgDisplay = false;
for (RunnerAndConfigurationSettings runConfiguration : allConfigurations) {
if (runConfiguration.getConfiguration().getFactory().getType() instanceof EmbeddedLinuxJVMConfigurationType) {
for (RunContentDescriptor descriptor : allDescriptors) {
if (runConfiguration.getName().equals(descriptor.getDisplayName())) {
try {
if (!exitMsgDisplay) {
consoleView.print(EmbeddedLinuxJVMBundle.message("exit.code.message", javaExitCode), ConsoleViewContentType.SYSTEM_OUTPUT);
exitMsgDisplay = true;
}
descriptor.setProcessHandler(null);
} catch (Exception e) {
}
}
}
}
}
}
示例7: setupRootModel
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的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);
}
}
示例8: update
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
@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);
}
示例9: actionPerformed
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event) {
final Project project = event.getProject();
if (project == null) {
return;
}
final RunnerAndConfigurationSettings settings =
RunManagerImpl.getInstanceImpl(project)
.findConfigurationByName(configType.getDisplayName());
ApplicationManager.getApplication()
.invokeLater(
new Runnable() {
@Override
public void run() {
if (settings == null) {
createNewConfiguration(project);
} else {
runExistingConfiguration(project, settings);
}
}
});
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:26,代码来源:CloudToolsRunConfigurationAction.java
示例10: createNewConfiguration
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
private void createNewConfiguration(Project project) {
final RunManagerImpl manager = RunManagerImpl.getInstanceImpl(project);
final ConfigurationFactory factory =
configType != null ? configType.getConfigurationFactories()[0] : null;
EditConfigurationsDialog dialog = new EditConfigurationsDialog(project, factory);
if (dialog.showAndGet()) {
RunnerAndConfigurationSettings settings = manager.getSelectedConfiguration();
if (settings != null) {
manager.addConfiguration(settings, false /*isShared*/);
}
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:17,代码来源:CloudToolsRunConfigurationAction.java
示例11: performAction
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
@Override
protected void performAction(AnActionEvent e) {
Project project = e.getProject();
RunnerAndConfigurationSettings selectedConfiguration =
RunManagerImpl.getInstanceImpl(project).getSelectedConfiguration();
if (selectedConfiguration == null) {
return;
}
RunConfiguration configuration = selectedConfiguration.getConfiguration();
if (configuration instanceof TaskConfiguration) {
TaskConfiguration taskConfiguration = (TaskConfiguration) configuration;
Test[] originalTests = taskConfiguration.getTests();
EditTestsDialog dialog = new EditTestsDialog(originalTests, project);
dialog.show();
if (!dialog.isOK()) {
return;
}
Test[] newTests = dialog.getTests();
taskConfiguration.setTests(newTests);
// @todo: save configuration
}
}
示例12: assertAndRunPantsMake
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
protected void assertAndRunPantsMake(JUnitConfiguration runConfiguration) {
RunManager runManager = RunManager.getInstance(myProject);
assertTrue(runManager instanceof RunManagerImpl);
RunManagerImpl runManagerImpl = (RunManagerImpl) runManager;
RunnerAndConfigurationSettings runnerAndConfigurationSettings =
runManagerImpl.createConfiguration(runConfiguration, JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);
runManagerImpl.addConfiguration(runnerAndConfigurationSettings, false);
// Make sure PantsMake is the one and only task before JUnit run.
List<BeforeRunTask<?>> beforeRunTaskList = runManagerImpl.getBeforeRunTasks(runConfiguration);
assertEquals(1, beforeRunTaskList.size());
BeforeRunTask task = beforeRunTaskList.iterator().next();
assertEquals(PantsMakeBeforeRun.ID, task.getProviderId());
/*
* Manually invoke BeforeRunTask as {@link ExecutionManager#compileAndRun} launches another task asynchronously,
* and there is no way to catch that.
*/
BeforeRunTaskProvider provider = BeforeRunTaskProvider.getProvider(myProject, task.getProviderId());
assertNotNull(String.format("Cannot find BeforeRunTaskProvider for id='%s'", task.getProviderId()), provider);
assertTrue(provider.executeTask(null, runConfiguration, null, task));
}
示例13: configurationPatchIfNecessary
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
/**
* Aplikování patche na budoucí konfigurace
*
* @param project aktuální projekt
* @param jre cesta k JVM
*/
private void configurationPatchIfNecessary( final @NotNull Project project, final @NotNull String jre )
{
// Template configuration.
RunManager runManager = RunManagerImpl.getInstance(project) ;
//Modifikace akutální konfigurací
for ( RunConfiguration configuration : runManager.getAllConfigurationsList() )
{
if (configuration instanceof ApplicationConfiguration)
{
patchConfiguration((ApplicationConfiguration) configuration, jre);
}
else if (configuration instanceof MavenRunConfiguration )
{
patchConfiguration((MavenRunConfiguration) configuration, jre);
}
}
}
示例14: initComponent
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
@Override
public void initComponent() {
RunManagerImpl.getInstanceImpl(myProject).addRunManagerListener(new RunManagerAdapter() {
@Override
public void runConfigurationChanged(@NotNull RunnerAndConfigurationSettings settings) {
if (settings == RunManager.getInstance(myProject).getSelectedConfiguration()) {
updateActiveTarget(settings);
}
}
@Override
public void runConfigurationSelected() {
updateActiveTarget();
}
});
}
示例15: findExistingByElement
import com.intellij.execution.impl.RunManagerImpl; //导入依赖的package包/类
@Override
protected RunnerAndConfigurationSettings findExistingByElement(Location location,
@NotNull RunnerAndConfigurationSettings[] existingConfigurations,
ConfigurationContext context) {
final TestNGConfiguration testNGConfiguration =
(TestNGConfiguration)context.getOriginalConfiguration(TestNGConfigurationType.getInstance());
final String vmParameters = testNGConfiguration != null ? testNGConfiguration.getVMParameters() : null;
final Module predefinedModule =
((TestNGConfiguration)((RunManagerImpl)RunManagerEx.getInstanceEx(location.getProject()))
.getConfigurationTemplate(getConfigurationFactory())
.getConfiguration()).getConfigurationModule().getModule();
for (RunnerAndConfigurationSettings existingConfiguration : existingConfigurations) {
TestNGConfiguration config = (TestNGConfiguration)existingConfiguration.getConfiguration();
if (vmParameters != null && !Comparing.strEqual(config.getVMParameters(), vmParameters)) continue;
TestData testobject = config.getPersistantData();
if (testobject != null){
final PsiElement element = location.getPsiElement();
if (testobject.isConfiguredByElement(element)) {
final Module configurationModule = config.getConfigurationModule().getModule();
if (Comparing.equal(location.getModule(), configurationModule)) return existingConfiguration;
if (Comparing.equal(predefinedModule, configurationModule)) return existingConfiguration;
}
}
}
return null;
}