当前位置: 首页>>代码示例>>Java>>正文


Java RunnerAndConfigurationSettings类代码示例

本文整理汇总了Java中com.intellij.execution.RunnerAndConfigurationSettings的典型用法代码示例。如果您正苦于以下问题:Java RunnerAndConfigurationSettings类的具体用法?Java RunnerAndConfigurationSettings怎么用?Java RunnerAndConfigurationSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RunnerAndConfigurationSettings类属于com.intellij.execution包,在下文中一共展示了RunnerAndConfigurationSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRemoteDebug

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的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: findExistingByElement

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@Override
protected RunnerAndConfigurationSettings findExistingByElement(Location location,
                                                               @NotNull List<RunnerAndConfigurationSettings> existingConfigurations,
                                                               ConfigurationContext context) {
  for (RunnerAndConfigurationSettings existingConfiguration : existingConfigurations) {
    final RunConfiguration configuration = existingConfiguration.getConfiguration();
    final GroovyScriptRunConfiguration existing = (GroovyScriptRunConfiguration)configuration;
    final String path = existing.getScriptPath();
    if (path != null) {
      final PsiFile file = location.getPsiElement().getContainingFile();
      if (file instanceof GroovyFile) {
        final VirtualFile vfile = file.getVirtualFile();
        if (vfile != null && FileUtil.toSystemIndependentName(path).equals(ScriptFileUtil.getScriptFilePath(vfile))) {
          if (!((GroovyFile)file).isScript() ||
              GroovyScriptUtil.getScriptType((GroovyFile)file).isConfigurationByLocation(existing, location)) {
            return existingConfiguration;
          }
        }
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:GroovyScriptRunConfigurationProducer.java

示例3: setupConfigurationModule

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
protected boolean setupConfigurationModule(@Nullable ConfigurationContext context, T configuration) {
  if (context != null) {
    final RunnerAndConfigurationSettings template = 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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaRunConfigurationProducerBase.java

示例4: createConfiguration

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@Nullable
private RunnerAndConfigurationSettings createConfiguration(@Nullable final PsiClass aClass) {
  if (aClass == null) return null;

  final Project project = aClass.getProject();
  RunnerAndConfigurationSettings settings = RunManagerEx.getInstanceEx(project).createConfiguration("", getConfigurationFactory());
  final GroovyScriptRunConfiguration configuration = (GroovyScriptRunConfiguration)settings.getConfiguration();
  final PsiFile file = aClass.getContainingFile().getOriginalFile();
  final PsiDirectory dir = file.getContainingDirectory();
  if (dir != null) {
    configuration.setWorkDir(dir.getVirtualFile().getPath());
  }
  final VirtualFile vFile = file.getVirtualFile();
  if (vFile == null) return null;
  String path = ScriptFileUtil.getScriptFilePath(vFile);
  configuration.setScriptPath(path);
  RunConfigurationModule module = configuration.getConfigurationModule();

  String name = GroovyRunnerUtil.getConfigurationName(aClass, module);
  configuration.setName(StringUtil.isEmpty(name) ? vFile.getName() : name);
  configuration.setModule(JavaExecutionUtil.findModule(aClass));
  return settings;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:GroovyScriptRunConfigurationProducer.java

示例5: createAndRunConfiguration

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@Override
public void createAndRunConfiguration(@NotNull ServerType<?> serverType, @Nullable RemoteServer<?> remoteServer) {
  DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
  RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
  ConfigurationFactoryEx factory = configurationType.getFactory();
  RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
  factory.onNewConfigurationCreated(settings.getConfiguration());
  DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>)settings.getConfiguration();
  if (remoteServer != null) {
    runConfiguration.setServerName(remoteServer.getName());
  }
  if (RunDialog.editConfiguration(myProject, settings, "Create Deployment Configuration",
                                  DefaultRunExecutor.getRunExecutorInstance())) {
    runManager.addConfiguration(settings, runManager.isConfigurationShared(settings), runManager.getBeforeRunTasks(runConfiguration),
                                false);
    runManager.setSelectedConfiguration(settings);
    ProgramRunnerUtil.executeConfiguration(myProject, settings, DefaultRunExecutor.getRunExecutorInstance());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DeploymentConfigurationManagerImpl.java

示例6: update

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  final Project project = e.getProject();
  e.getPresentation().setEnabledAndVisible(
    project != null && ProjectFacetManager.getInstance(project).hasFacets(AppEngineFacet.ID));

  if (project != null) {
    String text;
    RunnerAndConfigurationSettings configurationToRun = getConfigurationToRun(project);
    if (configurationToRun == null) {
      text = getTemplatePresentation().getText();
    }
    else {
      text = "Upload App Engine Application '" + configurationToRun.getName() + "'";
    }
    e.getPresentation().setText(text);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UploadApplicationAction.java

示例7: runConfigurationRemoved

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@Override
public void runConfigurationRemoved(@NotNull RunnerAndConfigurationSettings settings) {
  if (settings.getConfiguration() instanceof ExternalSystemRunConfiguration) {
    final Pair<String, RunnerAndConfigurationSettings> pair = myMap.remove(System.identityHashCode(settings));
    if (pair == null) return;

    final ExternalProjectsManager.ExternalProjectsStateProvider stateProvider = myManager.getStateProvider();
    final ExternalSystemTaskExecutionSettings taskExecutionSettings =
      ((ExternalSystemRunConfiguration)settings.getConfiguration()).getSettings();

    if(taskExecutionSettings.getExternalProjectPath() == null) return;

    final TaskActivationState activation =
      stateProvider.getTasksActivation(taskExecutionSettings.getExternalSystemId(), taskExecutionSettings.getExternalProjectPath());

    for (Phase phase : Phase.values()) {
      for (Iterator<String> iterator = activation.getTasks(phase).iterator(); iterator.hasNext(); ) {
        String task = iterator.next();
        if (pair.first.equals(task)) {
          iterator.remove();
          break;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ExternalSystemRunManagerListener.java

示例8: attach

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
public void attach() {
  myMap.clear();

  for (ExternalSystemManager<?, ?, ?, ?, ?> systemManager : ExternalSystemApiUtil.getAllManagers()) {
    final AbstractExternalSystemTaskConfigurationType configurationType =
      ExternalSystemUtil.findConfigurationType(systemManager.getSystemId());
    if (configurationType == null) continue;
    final List<RunnerAndConfigurationSettings> configurationSettingsList =
      RunManager.getInstance(myManager.getProject()).getConfigurationSettingsList(configurationType);
    for (RunnerAndConfigurationSettings configurationSettings : configurationSettingsList) {
      add(myMap, configurationSettings);
    }
  }

  ((RunManagerEx)RunManager.getInstance(myManager.getProject())).addRunManagerListener(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExternalSystemRunManagerListener.java

示例9: addTestRunConfiguration

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
private static void addTestRunConfiguration(final AndroidFacet facet, @NotNull TargetSelectionMode mode, @Nullable String preferredAvd) {
  Project project = facet.getModule().getProject();
  RunManager runManager = RunManager.getInstance(project);
  Module module = facet.getModule();
  RunnerAndConfigurationSettings settings = runManager
    .createRunConfiguration(module.getName(), AndroidTestRunConfigurationType.getInstance().getFactory());

  AndroidTestRunConfiguration configuration = (AndroidTestRunConfiguration)settings.getConfiguration();
  configuration.setModule(module);
  configuration.setTargetSelectionMode(mode);
  if (preferredAvd != null) {
    configuration.PREFERRED_AVD = preferredAvd;
  }

  runManager.addConfiguration(settings, false);
  runManager.setSelectedConfiguration(settings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AndroidModuleBuilder.java

示例10: getTasks

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@NotNull
private static List<TaskData> getTasks(AnActionEvent e) {
  final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
  if (selectedNodes == null) return Collections.emptyList();

  List<TaskData> tasks = new SmartList<TaskData>();
  for (ExternalSystemNode node : selectedNodes) {
    if (node instanceof TaskNode && !node.isIgnored()) {
      tasks.add((TaskData)node.getData());
    }
    else if (node instanceof RunConfigurationNode) {
      final RunnerAndConfigurationSettings configurationSettings = ((RunConfigurationNode)node).getSettings();
      final ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration)configurationSettings.getConfiguration();
      final ExternalSystemTaskExecutionSettings taskExecutionSettings = runConfiguration.getSettings();
      tasks.add(new TaskData(taskExecutionSettings.getExternalSystemId(), RUN_CONFIGURATION_TASK_PREFIX + configurationSettings.getName(),
                             taskExecutionSettings.getExternalProjectPath(), null));
    }
    else {
      return Collections.emptyList();
    }
  }
  return tasks;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ToggleTaskActivationAction.java

示例11: maybeAddRunConfiguration

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
/**
 * Adds a run configuration for an android_binary target if there is not already a configuration
 * for that target.
 */
private static void maybeAddRunConfiguration(
    Project project, BlazeProjectData blazeProjectData, Label label) {
  RunManager runManager = RunManager.getInstance(project);

  for (BlazeRunConfigurationFactory configurationFactory :
      BlazeRunConfigurationFactory.EP_NAME.getExtensions()) {
    if (configurationFactory.handlesTarget(project, blazeProjectData, label)) {
      final RunnerAndConfigurationSettings settings =
          configurationFactory.createForTarget(project, runManager, label);
      runManager.addConfiguration(settings, /* isShared */ false);
      if (runManager.getSelectedConfiguration() == null) {
        runManager.setSelectedConfiguration(settings);
      }
      break;
    }
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:BlazeRunConfigurationSyncListener.java

示例12: setupConfigurationFromContext

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
@Override
protected boolean setupConfigurationFromContext(TestNGConfiguration configuration,
                                                ConfigurationContext context,
                                                Ref<PsiElement> sourceElement) {
  final PsiElement element = context.getPsiLocation();
  final PsiFile containingFile = element != null ? element.getContainingFile() : null;
  if (containingFile == null) return false;
  final VirtualFile virtualFile = containingFile.getVirtualFile();
  if (virtualFile == null || !virtualFile.isValid()) return false;
  if (!TestNGUtil.isTestngXML(virtualFile)) return false;
  RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(context);
  setupConfigurationModule(context, configuration);
  final Module originalModule = configuration.getConfigurationModule().getModule();
  configuration.getPersistantData().SUITE_NAME = virtualFile.getPath();
  configuration.getPersistantData().TEST_OBJECT = TestType.SUITE.getType();
  configuration.restoreOriginalModule(originalModule);
  configuration.setGeneratedName();
  settings.setName(configuration.getName());
  sourceElement.set(containingFile);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AbstractTestNGSuiteConfigurationProducer.java

示例13: verifyState

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
private void verifyState() {
  if (! myShared.isEmpty()) {
    final Collection<RunnerAndConfigurationSettings> sharedConfigurations = getSharedConfigurations();
    final List<RunnerAndConfigurationSettings> canNotBeShared = new ArrayList<RunnerAndConfigurationSettings>();
    final Iterator<RunnerAndConfigurationSettings> iterator = sharedConfigurations.iterator();
    while (iterator.hasNext()) {
      final RunnerAndConfigurationSettings configuration = iterator.next();
      if (! myRunManager.isConfigurationShared(configuration)) {
        iterator.remove();
        canNotBeShared.add(configuration);
      }
    }
    if (! canNotBeShared.isEmpty()) {
      canNotBeShared.addAll(getLocalConfigurations());
      setStartupConfigurations(sharedConfigurations, canNotBeShared);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ProjectStartupTaskManager.java

示例14: getConfigurations

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ProjectStartupTaskManager.java

示例15: ConfigurationSettingsEditorWrapper

import com.intellij.execution.RunnerAndConfigurationSettings; //导入依赖的package包/类
public ConfigurationSettingsEditorWrapper(final RunnerAndConfigurationSettings settings) {
  myEditor = new ConfigurationSettingsEditor(settings);
  Disposer.register(this, myEditor);
  myBeforeRunStepsPanel = new BeforeRunStepsPanel(this);
  myDecorator = new HideableDecorator(myBeforeLaunchContainer, "", false) {
    @Override
    protected void on() {
      super.on();
      storeState();
    }

    @Override
    protected void off() {
      super.off();
      storeState();
    }

    private void storeState() {
      PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()));
    }
  };
  myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true));
  myDecorator.setContentComponent(myBeforeRunStepsPanel);
  doReset(settings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ConfigurationSettingsEditorWrapper.java


注:本文中的com.intellij.execution.RunnerAndConfigurationSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。