use of com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings in project intellij-community by JetBrains.
the class RunConfigurationNode method update.
@Override
protected void update(PresentationData presentation) {
super.update(presentation);
presentation.setIcon(ProgramRunnerUtil.getConfigurationIcon(mySettings, false));
final ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration) mySettings.getConfiguration();
final ExternalSystemTaskExecutionSettings taskExecutionSettings = runConfiguration.getSettings();
final String shortcutHint = StringUtil.nullize(getShortcutsManager().getDescription(taskExecutionSettings.getExternalProjectPath(), mySettings.getName()));
final String activatorHint = StringUtil.nullize(getTaskActivator().getDescription(taskExecutionSettings.getExternalSystemId(), taskExecutionSettings.getExternalProjectPath(), getRunConfigurationActivationTaskName(mySettings)));
String hint;
if (shortcutHint == null) {
hint = activatorHint;
} else if (activatorHint == null) {
hint = shortcutHint;
} else {
hint = shortcutHint + ", " + activatorHint;
}
setNameAndTooltip(getName(), StringUtil.join(taskExecutionSettings.getTaskNames(), " "), hint);
}
use of com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings in project intellij-community by JetBrains.
the class ExternalSystemActionUtil method buildTaskInfo.
@NotNull
public static ExternalTaskExecutionInfo buildTaskInfo(@NotNull TaskData task) {
ExternalSystemTaskExecutionSettings settings = new ExternalSystemTaskExecutionSettings();
settings.setExternalProjectPath(task.getLinkedExternalProjectPath());
settings.setTaskNames(Collections.singletonList(task.getName()));
settings.setTaskDescriptions(Collections.singletonList(task.getDescription()));
settings.setExternalSystemIdString(task.getOwner().toString());
return new ExternalTaskExecutionInfo(settings, DefaultRunExecutor.EXECUTOR_ID);
}
use of com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings in project intellij-community by JetBrains.
the class AbstractExternalSystemRunConfigurationProducer method setupConfigurationFromContext.
@Override
protected boolean setupConfigurationFromContext(ExternalSystemRunConfiguration configuration, ConfigurationContext context, Ref<PsiElement> sourceElement) {
Project project = getProjectFromContext(context);
if (project == null)
return false;
ExternalSystemTaskExecutionSettings contextTaskExecutionSettings = getTaskSettingsFromContext(context);
if (contextTaskExecutionSettings == null)
return false;
ExternalSystemTaskExecutionSettings taskExecutionSettings = configuration.getSettings();
if (!contextTaskExecutionSettings.getExternalSystemId().equals(taskExecutionSettings.getExternalSystemId())) {
return false;
}
taskExecutionSettings.setExternalProjectPath(contextTaskExecutionSettings.getExternalProjectPath());
taskExecutionSettings.setTaskNames(contextTaskExecutionSettings.getTaskNames());
configuration.setName(AbstractExternalSystemTaskConfigurationType.generateName(project, taskExecutionSettings));
return true;
}
use of com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings in project intellij-community by JetBrains.
the class AbstractExternalSystemRunConfigurationProducer method isConfigurationFromContext.
@Override
public boolean isConfigurationFromContext(ExternalSystemRunConfiguration configuration, ConfigurationContext context) {
Project project = getProjectFromContext(context);
if (project == null)
return false;
ExternalSystemTaskExecutionSettings contextTaskExecutionSettings = getTaskSettingsFromContext(context);
if (contextTaskExecutionSettings == null)
return false;
ExternalSystemTaskExecutionSettings taskExecutionSettings = configuration.getSettings();
if (!contextTaskExecutionSettings.getExternalSystemId().equals(taskExecutionSettings.getExternalSystemId())) {
return false;
}
if (!StringUtil.equals(contextTaskExecutionSettings.getExternalProjectPath(), taskExecutionSettings.getExternalProjectPath())) {
return false;
}
if (!contextTaskExecutionSettings.getTaskNames().equals(taskExecutionSettings.getTaskNames()))
return false;
return true;
}
use of com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings in project intellij-community by JetBrains.
the class AbstractExternalSystemRuntimeConfigurationProducer method createConfigurationByElement.
@Nullable
@Override
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
if (!(location instanceof ExternalSystemTaskLocation)) {
return null;
}
ExternalSystemTaskLocation taskLocation = (ExternalSystemTaskLocation) location;
mySourceElement = taskLocation.getPsiElement();
RunManagerEx runManager = RunManagerEx.getInstanceEx(taskLocation.getProject());
RunnerAndConfigurationSettings settings = runManager.createConfiguration("", getConfigurationFactory());
ExternalSystemRunConfiguration configuration = (ExternalSystemRunConfiguration) settings.getConfiguration();
ExternalSystemTaskExecutionSettings taskExecutionSettings = configuration.getSettings();
ExternalTaskExecutionInfo task = taskLocation.getTaskInfo();
taskExecutionSettings.setExternalProjectPath(task.getSettings().getExternalProjectPath());
taskExecutionSettings.setTaskNames(task.getSettings().getTaskNames());
configuration.setName(AbstractExternalSystemTaskConfigurationType.generateName(location.getProject(), taskExecutionSettings));
return settings;
}
Aggregations