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


Java ProgramRunner.canRun方法代码示例

本文整理汇总了Java中com.intellij.execution.runners.ProgramRunner.canRun方法的典型用法代码示例。如果您正苦于以下问题:Java ProgramRunner.canRun方法的具体用法?Java ProgramRunner.canRun怎么用?Java ProgramRunner.canRun使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.runners.ProgramRunner的用法示例。


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

示例1: canExecuteTask

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public boolean canExecuteTask(RunConfiguration configuration, ExternalSystemBeforeRunTask beforeRunTask) {
  final ExternalSystemTaskExecutionSettings executionSettings = beforeRunTask.getTaskExecutionSettings();

  final List<ExternalTaskPojo> tasks = ContainerUtilRt.newArrayList();
  for (String taskName : executionSettings.getTaskNames()) {
    tasks.add(new ExternalTaskPojo(taskName, executionSettings.getExternalProjectPath(), null));
  }
  if (tasks.isEmpty()) return true;

  final Pair<ProgramRunner, ExecutionEnvironment> pair =
    ExternalSystemUtil.createRunner(executionSettings, DefaultRunExecutor.EXECUTOR_ID, myProject, mySystemId);

  if (pair == null) return false;

  final ProgramRunner runner = pair.first;
  final ExecutionEnvironment environment = pair.second;

  return runner.canRun(DefaultRunExecutor.EXECUTOR_ID, environment.getRunProfile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ExternalSystemBeforeRunTaskProvider.java

示例2: checkSettings

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public void checkSettings(@Nullable Executor executor) throws RuntimeConfigurationException {
  myConfiguration.checkConfiguration();
  if (myConfiguration instanceof RunConfigurationBase) {
    final RunConfigurationBase runConfigurationBase = (RunConfigurationBase) myConfiguration;
    Set<ProgramRunner> runners = new THashSet<ProgramRunner>();
    runners.addAll(myRunnerSettings.settings.keySet());
    runners.addAll(myConfigurationPerRunnerSettings.settings.keySet());
    for (ProgramRunner runner : runners) {
      if (executor == null || runner.canRun(executor.getId(), myConfiguration)) {
        runConfigurationBase.checkRunnerSettings(runner, myRunnerSettings.settings.get(runner), myConfigurationPerRunnerSettings.settings.get(runner));
      }
    }
    if (executor != null) {
      runConfigurationBase.checkSettingsBeforeRun();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:RunnerAndConfigurationSettingsImpl.java

示例3: checkSettings

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public void checkSettings(@Nullable Executor executor) throws RuntimeConfigurationException {
  myConfiguration.checkConfiguration();
  if (myConfiguration instanceof RunConfigurationBase) {
    final RunConfigurationBase runConfigurationBase = (RunConfigurationBase) myConfiguration;
    Set<ProgramRunner> runners = new HashSet<ProgramRunner>();
    runners.addAll(myRunnerSettings.keySet());
    runners.addAll(myConfigurationPerRunnerSettings.keySet());
    for (ProgramRunner runner : runners) {
      if (executor == null || runner.canRun(executor.getId(), myConfiguration)) {
        runConfigurationBase.checkRunnerSettings(runner, myRunnerSettings.get(runner), myConfigurationPerRunnerSettings.get(runner));
      }
    }
    if (executor != null) {
      runConfigurationBase.checkSettingsBeforeRun();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:RunnerAndConfigurationSettingsImpl.java

示例4: checkSettings

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public void checkSettings(@Nullable Executor executor) throws RuntimeConfigurationException {
  myConfiguration.checkConfiguration();
  if (myConfiguration instanceof RunConfigurationBase) {
    final RunConfigurationBase runConfigurationBase = (RunConfigurationBase) myConfiguration;
    Set<ProgramRunner> runners = new THashSet<ProgramRunner>();
    runners.addAll(myRunnerSettings.keySet());
    runners.addAll(myConfigurationPerRunnerSettings.keySet());
    for (ProgramRunner runner : runners) {
      if (executor == null || runner.canRun(executor.getId(), myConfiguration)) {
        runConfigurationBase.checkRunnerSettings(runner, myRunnerSettings.get(runner), myConfigurationPerRunnerSettings.get(runner));
      }
    }
    if (executor != null) {
      runConfigurationBase.checkSettingsBeforeRun();
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:RunnerAndConfigurationSettingsImpl.java

示例5: getRunner

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public ProgramRunner getRunner(@NotNull String executorId, @Nullable RunProfile settings) {
  if (settings == null) {
    return null;
  }

  for (ProgramRunner runner : ProgramRunner.PROGRAM_RUNNER_EP.getExtensions()) {
    if (runner.canRun(executorId, settings)) {
      return runner;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:RunnerRegistryImpl.java

示例6: canExecuteTask

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public boolean canExecuteTask(RunConfiguration configuration,
                              RunConfigurableBeforeRunTask task) {
  RunnerAndConfigurationSettings settings = task.getSettings();
  if (settings == null) {
    return false;
  }
  String executorId = DefaultRunExecutor.getRunExecutorInstance().getId();
  final ProgramRunner runner = ProgramRunnerUtil.getRunner(executorId, settings);
  return runner != null && runner.canRun(executorId, settings.getConfiguration());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RunConfigurationBeforeRunProvider.java

示例7: getValidationResult

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Nullable
private ValidationResult getValidationResult() {
  if (!myValidationResultValid) {
    myLastValidationResult = null;
    try {
      RunnerAndConfigurationSettings snapshot = getSnapshot();
      if (snapshot != null) {
        snapshot.setName(getNameText());
        snapshot.checkSettings(myExecutor);
        for (ProgramRunner runner : RunnerRegistry.getInstance().getRegisteredRunners()) {
          for (Executor executor : ExecutorRegistry.getInstance().getRegisteredExecutors()) {
            if (runner.canRun(executor.getId(), snapshot.getConfiguration())) {
              checkConfiguration(runner, snapshot);
              break;
            }
          }
        }
      }
    }
    catch (RuntimeConfigurationException exception) {
      myLastValidationResult =
          exception != null ? new ValidationResult(exception.getLocalizedMessage(), exception.getTitle(), exception.getQuickFix()) : null;
    }
    catch (ConfigurationException e) {
      myLastValidationResult = new ValidationResult(e.getLocalizedMessage(), ExecutionBundle.message("invalid.data.dialog.title"), null);
    }

    myValidationResultValid = true;
  }
  return myLastValidationResult;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:SingleConfigurationConfigurable.java

示例8: hasRunner

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public boolean hasRunner(@NotNull final String executorId, @NotNull final RunProfile settings) {
  final ProgramRunner[] runners = getRegisteredRunners();
  for (final ProgramRunner runner : runners) {
    if (runner.canRun(executorId, settings)) {
      return true;
    }
  }

  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:RunnerRegistryImpl.java

示例9: getRunner

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public ProgramRunner getRunner(@NotNull final String executorId, final RunProfile settings) {
  if (settings == null) return null;
  final ProgramRunner[] runners = getRegisteredRunners();
  for (final ProgramRunner runner : runners) {
    if (runner.canRun(executorId, settings)) {
      return runner;
    }
  }

  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:RunnerRegistryImpl.java

示例10: canExecuteTask

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public boolean canExecuteTask(RunConfiguration configuration,
                              RunConfigurableBeforeRunTask task) {
  RunnerAndConfigurationSettings settings = task.getSettings();
  if (settings == null) {
    return false;
  }
  String executorId = DefaultRunExecutor.getRunExecutorInstance().getId();
  final ProgramRunner runner = ProgramRunnerUtil.getRunner(executorId, settings);
  if (runner == null)
    return false;
  return runner.canRun(executorId, settings.getConfiguration());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:RunConfigurationBeforeRunProvider.java

示例11: getValidationResult

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Nullable
private ValidationResult getValidationResult() {
  if (!myValidationResultValid) {
    myLastValidationResult = null;
    try {
      RunnerAndConfigurationSettings snapshot = getSnapshot();
      if (snapshot != null) {
        snapshot.setName(getNameText());
        snapshot.checkSettings(myExecutor);
        for (ProgramRunner runner : RunnerRegistry.getInstance().getRegisteredRunners()) {
          for (Executor executor : ExecutorRegistry.getInstance().getRegisteredExecutors()) {
            if (runner.canRun(executor.getId(), snapshot.getConfiguration())) {
              checkConfiguration(runner, snapshot);
              break;
            }
          }
        }
      }
    }
    catch (RuntimeConfigurationException exception) {
      myLastValidationResult =
        exception != null ? new ValidationResult(exception.getLocalizedMessage(), exception.getTitle(), exception.getQuickFix()) : null;
    }
    catch (ConfigurationException e) {
      myLastValidationResult = new ValidationResult(e.getLocalizedMessage(), ExecutionBundle.message("invalid.data.dialog.title"), null);
    }

    myValidationResultValid = true;
  }
  return myLastValidationResult;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:SingleConfigurationConfigurable.java

示例12: hasRunner

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public boolean hasRunner(@Nonnull final String executorId, @Nonnull final RunProfile settings) {
  final ProgramRunner[] runners = getRegisteredRunners();
  for (final ProgramRunner runner : runners) {
    if (runner.canRun(executorId, settings)) {
      return true;
    }
  }

  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:RunnerRegistryImpl.java

示例13: getRunner

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
@Override
public ProgramRunner getRunner(final String executorId, final RunProfile settings) {
  final ProgramRunner[] runners = getRegisteredRunners();
  for (final ProgramRunner runner : runners) {
    if (runner.canRun(executorId, settings)) {
      return runner;
    }
  }

  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:RunnerRegistryImpl.java

示例14: init

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
private void init() {
  if (myCompound == null) {
    myCompound = new SettingsEditorGroup<RunnerAndConfigurationSettings>();
    Disposer.register(this, myCompound);
    if (myConfigurationEditor instanceof SettingsEditorGroup) {
      SettingsEditorGroup<RunConfiguration> group = (SettingsEditorGroup<RunConfiguration>)myConfigurationEditor;
      List<Pair<String, SettingsEditor<RunConfiguration>>> editors = group.getEditors();
      for (Pair<String, SettingsEditor<RunConfiguration>> pair : editors) {
        myCompound.addEditor(pair.getFirst(), new ConfigToSettingsWrapper(pair.getSecond()));
      }
    }
    else {
      myCompound.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"),
                           new ConfigToSettingsWrapper(myConfigurationEditor));
    }


    myRunnersComponent = new RunnersEditorComponent();
    ProgramRunner[] runners = RunnerRegistry.getInstance().getRegisteredRunners();

    final Executor[] executors = ExecutorRegistry.getInstance().getRegisteredExecutors();
    for (final Executor executor : executors) {
      for (ProgramRunner runner : runners) {
        if (runner.canRun(executor.getId(), myConfiguration)) {
          JComponent perRunnerSettings = createCompositePerRunnerSettings(executor, runner);
          if (perRunnerSettings != null) {
            myRunnersComponent.addExecutorComponent(executor, perRunnerSettings);
          }
        }
      }
    }

    if (myRunnerEditors.size() > 0) {
      myCompound.addEditor(ExecutionBundle.message("run.configuration.startup.connection.rab.title"),
                           new CompositeSettingsEditor<RunnerAndConfigurationSettings>(getFactory()) {
                             @Override
                             public CompositeSettingsBuilder<RunnerAndConfigurationSettings> getBuilder() {
                               return new CompositeSettingsBuilder<RunnerAndConfigurationSettings>() {
                                 @Override
                                 public Collection<SettingsEditor<RunnerAndConfigurationSettings>> getEditors() {
                                   return myRunnerEditors;
                                 }

                                 @Override
                                 public JComponent createCompoundEditor() {
                                   return myRunnersComponent.getComponent();
                                 }
                               };
                             }
                           });
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:54,代码来源:ConfigurationSettingsEditor.java

示例15: init

import com.intellij.execution.runners.ProgramRunner; //导入方法依赖的package包/类
private void init() {
  if (myCompound == null) {
    myCompound = new SettingsEditorGroup<RunnerAndConfigurationSettings>();
    Disposer.register(this, myCompound);
    if (myConfigurationEditor instanceof SettingsEditorGroup) {
      SettingsEditorGroup<RunConfiguration> group = (SettingsEditorGroup<RunConfiguration>)myConfigurationEditor;
      List<Pair<String, SettingsEditor<RunConfiguration>>> editors = group.getEditors();
      for (Pair<String, SettingsEditor<RunConfiguration>> pair : editors) {
        myCompound.addEditor(pair.getFirst(), new ConfigToSettingsWrapper(pair.getSecond()));
      }
    }
    else {
      myCompound.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"),
                           new ConfigToSettingsWrapper(myConfigurationEditor));
    }


    myRunnersComponent = new RunnersEditorComponent();
    ProgramRunner[] runners = RunnerRegistry.getInstance().getRegisteredRunners();

    final Executor[] executors = ExecutorRegistry.getInstance().getRegisteredExecutors();
    for (final Executor executor : executors) {
      for (ProgramRunner runner : runners) {
        if (runner.canRun(executor.getId(), myConfiguration)) {
          JComponent perRunnerSettings = createCompositePerRunnerSettings(executor, runner);
          if (perRunnerSettings != null) {
            myRunnersComponent.addExecutorComponent(executor, perRunnerSettings);
          }
        }
      }
    }

    if (myRunnerEditors.size() > 0) {
      myCompound.addEditor(ExecutionBundle.message("run.configuration.startup.connection.rab.title"),
                           new CompositeSettingsEditor<RunnerAndConfigurationSettings>(getFactory()) {
                             @Override
                             public CompositeSettingsBuilder<RunnerAndConfigurationSettings> getBuilder() {
                               return new CompositeSettingsBuilder<RunnerAndConfigurationSettings>() {
                                 @Nonnull
                                 @Override
                                 public Collection<SettingsEditor<RunnerAndConfigurationSettings>> getEditors() {
                                   return myRunnerEditors;
                                 }

                                 @Nonnull
                                 @Override
                                 public JComponent createCompoundEditor(@Nonnull Disposable disposable) {
                                   return myRunnersComponent.getComponent();
                                 }
                               };
                             }
                           });
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:56,代码来源:ConfigurationSettingsEditor.java


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