本文整理汇总了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());
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
};
}
});
}
}
}
示例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();
}
};
}
});
}
}
}