本文整理汇总了Java中com.intellij.execution.RunnerAndConfigurationSettings.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java RunnerAndConfigurationSettings.getConfiguration方法的具体用法?Java RunnerAndConfigurationSettings.getConfiguration怎么用?Java RunnerAndConfigurationSettings.getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.RunnerAndConfigurationSettings
的用法示例。
在下文中一共展示了RunnerAndConfigurationSettings.getConfiguration方法的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) {
final XmlFile file = PsiTreeUtil.getParentOfType(location.getPsiElement(), XmlFile.class, false);
if (file != null && file.isPhysical() && XsltSupport.isXsltFile(file)) {
for (RunnerAndConfigurationSettings existingConfiguration : existingConfigurations) {
final RunConfiguration configuration = existingConfiguration.getConfiguration();
if (configuration instanceof XsltRunConfiguration) {
if (file.getVirtualFile().getPath().replace('/', File.separatorChar)
.equals(((XsltRunConfiguration)configuration).getXsltFile())) {
return existingConfiguration;
}
}
}
}
return null;
}
示例3: shouldLoadConfiguration
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
/**
* Returns true if there's either no matching configuration already in the project, or the
* matching configuration is marked as 'keep in sync'.
*/
@VisibleForTesting
static boolean shouldLoadConfiguration(Project project, Element element)
throws InvalidDataException {
RunnerAndConfigurationSettings existing = findExisting(project, element);
if (existing == null) {
return true;
}
RunConfiguration config = existing.getConfiguration();
if (!(config instanceof BlazeRunConfiguration)) {
// always overwrite non-blaze run configurations
return true;
}
BlazeRunConfiguration blazeConfig = (BlazeRunConfiguration) config;
Boolean keepInSync = blazeConfig.getKeepInSync();
if (keepInSync == null) {
// if the matching configuration was never previously imported, don't overwrite, but activate
// the UI option to keep it in sync.
blazeConfig.setKeepInSync(false);
return false;
}
return keepInSync;
}
示例4: createConfigurationByElement
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@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;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractExternalSystemRuntimeConfigurationProducer.java
示例5: 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;
}
示例6: removeMake
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
private void removeMake(final Project project) {
final RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project);
if (runManager == null) {
return;
}
final AntRunConfigurationType antRunConfigurationType = ConfigurationTypeUtil.findConfigurationType(
AntRunConfigurationType.class);
final ConfigurationFactory configurationFactory = antRunConfigurationType.getConfigurationFactories()[0];
final RunnerAndConfigurationSettings template = runManager.getConfigurationTemplate(configurationFactory);
final AntRunConfiguration runConfiguration = (AntRunConfiguration) template.getConfiguration();
runManager.setBeforeRunTasks(runConfiguration, Collections.<BeforeRunTask>emptyList(), false);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:13,代码来源:DefaultAntConfigurator.java
示例7: createConfigurationFromLocation
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Nullable
protected RunConfiguration createConfigurationFromLocation(PsiFile psiFile) {
MapDataContext dataContext = new MapDataContext();
dataContext.put(CommonDataKeys.PROJECT, getProject());
dataContext.put(LangDataKeys.MODULE, ModuleUtil.findModuleForPsiElement(psiFile));
dataContext.put(Location.DATA_KEY, PsiLocation.fromPsiElement(psiFile));
RunnerAndConfigurationSettings settings =
ConfigurationContext.getFromContext(dataContext).getConfiguration();
return settings != null ? settings.getConfiguration() : null;
}
示例8: createConfigurationByElement
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Override
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
location = JavaExecutionUtil.stepIntoSingleClass(location);
if (location == null) return null;
final Project project = location.getProject();
final PsiElement element = location.getPsiElement();
myPsiClass = getAppletClass(element, PsiManager.getInstance(project));
if (myPsiClass == null) return null;
RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(project, context);
final AppletConfiguration configuration = (AppletConfiguration)settings.getConfiguration();
configuration.MAIN_CLASS_NAME = JavaExecutionUtil.getRuntimeQualifiedName(myPsiClass);
configuration.setModule(myPsiClass.isValid() ? ModuleUtilCore.findModuleForPsiElement(myPsiClass) : null);
configuration.setGeneratedName();
return settings;
}
示例9: doSetup
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Before
public final void doSetup() {
runManager = RunManagerImpl.getInstanceImpl(getProject());
// Without BlazeProjectData, the configuration editor is always disabled.
BlazeProjectDataManager mockProjectDataManager =
new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
type = BlazeCommandRunConfigurationType.getInstance();
RunnerAndConfigurationSettings runnerAndConfigurationSettings =
runManager.createConfiguration("Blaze Configuration", type.getFactory());
runManager.addConfiguration(runnerAndConfigurationSettings, false);
configuration =
(BlazeCommandRunConfiguration) runnerAndConfigurationSettings.getConfiguration();
}
示例10: findExistingByElement
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Override
protected RunnerAndConfigurationSettings findExistingByElement(Location location,
@NotNull List<RunnerAndConfigurationSettings> existingConfigurations,
ConfigurationContext context) {
final MavenRunnerParameters runnerParameters = createBuildParameters(location);
for (RunnerAndConfigurationSettings existingConfiguration : existingConfigurations) {
final RunConfiguration configuration = existingConfiguration.getConfiguration();
if (configuration instanceof MavenRunConfiguration &&
((MavenRunConfiguration)configuration).getRunnerParameters().equals(runnerParameters)) {
return existingConfiguration;
}
}
return null;
}
示例11: createConfigurationSettings
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
private static RunnerAndConfigurationSettings createConfigurationSettings(ConfigurationFactory factory, @NotNull final Module module) {
final RunnerAndConfigurationSettings settings =
RunManager.getInstance(module.getProject()).createRunConfiguration(module.getName(), factory);
ModuleBasedConfiguration configuration = (ModuleBasedConfiguration) settings.getConfiguration();
configuration.setModule(module);
return settings;
}
示例12: updateRunConfigurations
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
public void updateRunConfigurations(MavenProject mavenProject) {
boolean childChanged = false;
Set<RunnerAndConfigurationSettings> settings = new THashSet<RunnerAndConfigurationSettings>(
RunManager.getInstance(myProject).getConfigurationSettingsList(MavenRunConfigurationType.getInstance()));
for (Iterator<RunConfigurationNode> itr = myChildren.iterator(); itr.hasNext(); ) {
RunConfigurationNode node = itr.next();
if (settings.remove(node.getSettings())) {
node.updateRunConfiguration();
}
else {
itr.remove();
childChanged = true;
}
}
String directory = PathUtil.getCanonicalPath(mavenProject.getDirectory());
int oldSize = myChildren.size();
for (RunnerAndConfigurationSettings cfg : settings) {
MavenRunConfiguration mavenRunConfiguration = (MavenRunConfiguration)cfg.getConfiguration();
if (directory.equals(PathUtil.getCanonicalPath(mavenRunConfiguration.getRunnerParameters().getWorkingDirPath()))) {
myChildren.add(new RunConfigurationNode(this, cfg));
}
}
if (oldSize != myChildren.size()) {
childChanged = true;
sort(myChildren);
}
if (childChanged) {
childrenChanged();
}
}
示例13: perform
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Override
public void perform(final ConfigurationContext context) {
final RunManagerImpl runManager = (RunManagerImpl)context.getRunManager();
final RunnerAndConfigurationSettings configuration = context.getConfiguration();
final RunnerAndConfigurationSettings template = runManager.getConfigurationTemplate(configuration.getFactory());
final RunConfiguration templateConfiguration = template.getConfiguration();
runManager.addConfiguration(configuration,
runManager.isConfigurationShared(template),
runManager.getBeforeRunTasks(templateConfiguration),
false);
runManager.setSelectedConfiguration(configuration);
}
示例14: doReset
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
void doReset(RunnerAndConfigurationSettings settings) {
myRunConfiguration = settings.getConfiguration();
originalTasks.clear();
RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(myRunConfiguration.getProject());
originalTasks.addAll(runManager.getBeforeRunTasks(myRunConfiguration));
myModel.replaceAll(originalTasks);
myShowSettingsBeforeRunCheckBox.setSelected(settings.isEditBeforeRun());
myShowSettingsBeforeRunCheckBox.setEnabled(!isUnknown());
myActivateToolWindowBeforeRunCheckBox.setSelected(settings.isActivateToolWindowBeforeRun());
myActivateToolWindowBeforeRunCheckBox.setEnabled(!isUnknown());
myPanel.setVisible(checkBeforeRunTasksAbility(false));
updateText();
}
示例15: createPythonScriptRunConfiguration
import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Override
public PythonRunConfigurationParams createPythonScriptRunConfiguration(Module module, String scriptName, boolean singleton) {
RunnerAndConfigurationSettings settings = createRunConfiguration(module, PythonConfigurationType.getInstance().getFactory());
settings.setSingleton(singleton);
PythonRunConfigurationParams configuration = (PythonRunConfigurationParams)settings.getConfiguration();
configuration.setScriptName(scriptName);
return configuration;
}