本文整理汇总了Java中com.intellij.execution.configurations.RunConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java RunConfiguration类的具体用法?Java RunConfiguration怎么用?Java RunConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RunConfiguration类属于com.intellij.execution.configurations包,在下文中一共展示了RunConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AppleScriptConfigurationType
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
public AppleScriptConfigurationType() {
super("AppleScriptRunType", "Run AppleScript", "Run Configuration for AppleScript", AppleScriptIcons.FILE);
addFactory(new ConfigurationFactory(this) {
@Override
public boolean isConfigurationSingletonByDefault() {
return true;
}
@Override
public boolean canConfigurationBeSingleton() {
return false;
}
@NotNull
@Override
public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
return new AppleScriptRunConfiguration(project, this, " Template config");
}
});
}
示例2: getAvailableConfigurations
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@NotNull
private static List<RunnerAndConfigurationSettings> getAvailableConfigurations(@NotNull RunConfiguration runConfiguration) {
Project project = runConfiguration.getProject();
if (project == null || !project.isInitialized()) {
return Collections.emptyList();
}
List<RunnerAndConfigurationSettings> configurations = new ArrayList<RunnerAndConfigurationSettings>(RunManagerImpl.getInstanceImpl(project).getSortedConfigurations());
String executorId = DefaultRunExecutor.getRunExecutorInstance().getId();
for (Iterator<RunnerAndConfigurationSettings> iterator = configurations.iterator(); iterator.hasNext();) {
RunnerAndConfigurationSettings settings = iterator.next();
ProgramRunner runner = ProgramRunnerUtil.getRunner(executorId, settings);
if (runner == null || settings.getConfiguration() == runConfiguration) {
iterator.remove();
}
}
return configurations;
}
示例3: update
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
final Presentation presentation = e.getPresentation();
presentation.setVisible(false);
final DataContext dataContext = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project != null) {
final RunConfiguration configuration = RunConfiguration.DATA_KEY.getData(dataContext);
if (isPatternBasedConfiguration(configuration)) {
final AbstractTestProxy testProxy = AbstractTestProxy.DATA_KEY.getData(dataContext);
if (testProxy != null) {
final Location location = testProxy.getLocation(project, ((T)configuration).getConfigurationModule().getSearchScope());
if (location != null) {
final PsiElement psiElement = location.getPsiElement();
if (psiElement instanceof PsiClass && getPattern((T)configuration).contains(((PsiClass)psiElement).getQualifiedName())) {
presentation.setVisible(true);
}
}
}
}
}
}
示例4: chooseSubclass
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@VisibleForTesting
static void chooseSubclass(
ConfigurationFromContext configuration,
ConfigurationContext context,
Runnable startRunnable) {
RunConfiguration config = configuration.getConfiguration();
if (!(config instanceof BlazeCommandRunConfiguration)) {
return;
}
AbstractTestLocation location = locationFromConfiguration(configuration);
if (location == null) {
return;
}
SubclassTestChooser.chooseSubclass(
context,
location.abstractClass,
(psiClass) -> {
if (psiClass != null) {
setupContext((BlazeCommandRunConfiguration) config, psiClass, location.method);
}
startRunnable.run();
});
}
示例5: configureTask
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
public boolean configureTask(RunConfiguration runConfiguration, BuildArtifactsBeforeRunTask task) {
final Artifact[] artifacts = ArtifactManager.getInstance(myProject).getArtifacts();
Set<ArtifactPointer> pointers = new THashSet<ArtifactPointer>();
for (Artifact artifact : artifacts) {
pointers.add(ArtifactPointerManager.getInstance(myProject).createPointer(artifact));
}
pointers.addAll(task.getArtifactPointers());
ArtifactChooser chooser = new ArtifactChooser(new ArrayList<ArtifactPointer>(pointers));
chooser.markElements(task.getArtifactPointers());
chooser.setPreferredSize(JBUI.size(400, 300));
DialogBuilder builder = new DialogBuilder(myProject);
builder.setTitle(CompilerBundle.message("build.artifacts.before.run.selector.title"));
builder.setDimensionServiceKey("#BuildArtifactsBeforeRunChooser");
builder.addOkAction();
builder.addCancelAction();
builder.setCenterPanel(chooser);
builder.setPreferredFocusComponent(chooser);
if (builder.show() == DialogWrapper.OK_EXIT_CODE) {
task.setArtifactPointers(chooser.getMarkedElements());
return true;
}
return false;
}
示例6: findExistingByElement
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@Nullable
@Override
protected RunnerAndConfigurationSettings findExistingByElement(Location location,
@NotNull List<RunnerAndConfigurationSettings> existingConfigurationsSettings,
ConfigurationContext context) {
if (!(location instanceof ExternalSystemTaskLocation)) {
return null;
}
ExternalTaskExecutionInfo taskInfo = ((ExternalSystemTaskLocation)location).getTaskInfo();
for (RunnerAndConfigurationSettings settings : existingConfigurationsSettings) {
RunConfiguration runConfiguration = settings.getConfiguration();
if (!(runConfiguration instanceof ExternalSystemRunConfiguration)) {
continue;
}
if (match(taskInfo, ((ExternalSystemRunConfiguration)runConfiguration).getSettings())) {
return settings;
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AbstractExternalSystemRuntimeConfigurationProducer.java
示例7: addRunConfiguration
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
public void addRunConfiguration(@NotNull final ConfigurationFactory factory) {
final RunConfigurable configurable = (RunConfigurable)getConfigurable();
final SingleConfigurationConfigurable<RunConfiguration> configuration = configurable.createNewConfiguration(factory);
if (!isVisible()) {
getContentPanel().addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {
if (configuration != null) {
configurable.updateRightPanel(configuration);
getContentPanel().removeComponentListener(this);
}
}
});
}
}
示例8: getTestFilter
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
private static Optional<String> getTestFilter(ConfigurationContext context) {
RunConfiguration base = context.getOriginalConfiguration(null);
if (!(base instanceof BlazeCommandRunConfiguration)) {
return Optional.empty();
}
TargetExpression target = ((BlazeCommandRunConfiguration) base).getTarget();
if (target == null) {
return Optional.empty();
}
List<Location<?>> selectedElements = SmRunnerUtils.getSelectedSmRunnerTreeElements(context);
if (selectedElements.isEmpty()) {
return null;
}
Optional<BlazeTestEventsHandler> testEventsHandler =
BlazeTestEventsHandler.getHandlerForTarget(context.getProject(), target);
return testEventsHandler.map(
handler -> handler.getTestFilter(context.getProject(), selectedElements));
}
示例9: writeConfiguration
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
private static void writeConfiguration(RunConfiguration configuration, File outputFile) {
try (FileOutputStream writer = new FileOutputStream(outputFile, false)) {
XMLOutputter xmlOutputter = new XMLOutputter(Format.getCompactFormat());
xmlOutputter.output(RunConfigurationSerializer.writeToXml(configuration), writer);
} catch (IOException e) {
throw new RuntimeException("Error exporting run configuration to file: " + outputFile);
}
}
示例10: update
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
private void update(RunConfiguration config, boolean enabled, RunManagerImpl runManager) {
List<BeforeRunTask> tasks = runManager.getBeforeRunTasks(config);
BeforeRunTaskProvider<T> provider = BeforeRunTaskProvider.getProvider(myProject, getTaskID());
if (provider == null)
return;
T task = provider.createTask(config);
update(task);
task.setEnabled(true);
if (enabled) {
if (!tasks.contains(task)) {
tasks.add(task);
}
}
else {
if (tasks.contains(task)) {
tasks.remove(task);
}
}
runManager.setBeforeRunTasks(config, tasks, false);
}
示例11: getData
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@Nullable
public static Object getData(final AbstractTestProxy testProxy, final String dataId, final TestFrameworkRunningModel model) {
final TestConsoleProperties properties = model.getProperties();
final Project project = properties.getProject();
if (testProxy == null) return null;
if (AbstractTestProxy.DATA_KEY.is(dataId)) return testProxy;
if (CommonDataKeys.NAVIGATABLE.is(dataId)) return getOpenFileDescriptor(testProxy, model);
if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
final Location location = testProxy.getLocation(project, properties.getScope());
if (location != null) {
final PsiElement element = location.getPsiElement();
return element.isValid() ? element : null;
}
else {
return null;
}
}
if (Location.DATA_KEY.is(dataId)) return testProxy.getLocation(project, properties.getScope());
if (RunConfiguration.DATA_KEY.is(dataId)) {
final RunProfile configuration = properties.getConfiguration();
if (configuration instanceof RunConfiguration) {
return configuration;
}
}
return null;
}
示例12: ConfigurationContext
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
private ConfigurationContext(final DataContext dataContext) {
myRuntimeConfiguration = RunConfiguration.DATA_KEY.getData(dataContext);
myContextComponent = PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext);
myModule = LangDataKeys.MODULE.getData(dataContext);
@SuppressWarnings({"unchecked"})
final Location<PsiElement> location = (Location<PsiElement>)Location.DATA_KEY.getData(dataContext);
if (location != null) {
myLocation = location;
return;
}
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
myLocation = null;
return;
}
final PsiElement element = getSelectedPsiElement(dataContext, project);
if (element == null) {
myLocation = null;
return;
}
myLocation = new PsiLocation<PsiElement>(project, myModule, element);
}
示例13: configureTask
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
public boolean configureTask(RunConfiguration runConfiguration, AntBeforeRunTask task) {
AntBuildTarget buildTarget = findTargetToExecute(task);
final TargetChooserDialog dlg = new TargetChooserDialog(myProject, buildTarget);
if (dlg.showAndGet()) {
task.setTargetName(null);
task.setAntFileUrl(null);
buildTarget = dlg.getSelectedTarget();
if (buildTarget != null) {
final VirtualFile vFile = buildTarget.getModel().getBuildFile().getVirtualFile();
if (vFile != null) {
task.setAntFileUrl(vFile.getUrl());
task.setTargetName(buildTarget.getName());
}
}
return true;
}
return false;
}
示例14: getConfigurationFactories
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@Override
public ConfigurationFactory[] getConfigurationFactories() {
return new ConfigurationFactory[]{new ConfigurationFactory(this) {
@NotNull
@Override
public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
return new LaravelRunConf(project, this, "Laravel");
}
}};
}
示例15: getProxy
import com.intellij.execution.configurations.RunConfiguration; //导入依赖的package包/类
@Nullable
@Override
public TestRecorderRunConfigurationProxy getProxy(@Nullable RunConfiguration runConfiguration) {
if (runConfiguration instanceof BlazeCommandRunConfiguration
&& ((BlazeCommandRunConfiguration) runConfiguration).getHandler()
instanceof BlazeAndroidBinaryRunConfigurationHandler) {
return new TestRecorderBlazeCommandRunConfigurationProxy(
(BlazeCommandRunConfiguration) runConfiguration);
}
return null;
}
开发者ID:bazelbuild,项目名称:intellij,代码行数:13,代码来源:TestRecorderBlazeCommandRunConfigurationProxyProvider.java