本文整理汇总了Java中com.intellij.execution.ProgramRunnerUtil类的典型用法代码示例。如果您正苦于以下问题:Java ProgramRunnerUtil类的具体用法?Java ProgramRunnerUtil怎么用?Java ProgramRunnerUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgramRunnerUtil类属于com.intellij.execution包,在下文中一共展示了ProgramRunnerUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndRunConfiguration
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void createAndRunConfiguration(@NotNull ServerType<?> serverType, @Nullable RemoteServer<?> remoteServer) {
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
ConfigurationFactoryEx factory = configurationType.getFactory();
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
factory.onNewConfigurationCreated(settings.getConfiguration());
DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>)settings.getConfiguration();
if (remoteServer != null) {
runConfiguration.setServerName(remoteServer.getName());
}
if (RunDialog.editConfiguration(myProject, settings, "Create Deployment Configuration",
DefaultRunExecutor.getRunExecutorInstance())) {
runManager.addConfiguration(settings, runManager.isConfigurationShared(settings), runManager.getBeforeRunTasks(runConfiguration),
false);
runManager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(myProject, settings, DefaultRunExecutor.getRunExecutorInstance());
}
}
示例2: update
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@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);
}
示例3: execute
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
/**
* Runs specified TaskConfiguration: generates code and then runs output configuration.
*
* @throws ClassCastException if {@code environment.getRunProfile()} is not {@link TaskConfiguration}.
* @throws ExecutionException if output configuration throws it.
* @see ExecutionEnvironment#getRunProfile()
*/
@Override
public void execute(@NotNull ExecutionEnvironment environment, @Nullable Callback callback) throws
ExecutionException {
Project project = environment.getProject();
TaskConfiguration taskConfiguration = (TaskConfiguration) environment.getRunProfile();
generateSubmissionFileForTask(project, taskConfiguration);
generateRunFileForTask(project, taskConfiguration);
List<RunnerAndConfigurationSettings> allSettings = RunManager.getInstance(project).getAllSettings();
RunnerAndConfigurationSettings outputSettings = null;
for (RunnerAndConfigurationSettings configuration : allSettings) {
if (configuration.getName().equals(RUN_CONFIGURATION_NAME)) {
outputSettings = configuration;
}
}
if (outputSettings == null) {
throw new NotificationException("No run configuration found", "It should be called (" + RUN_CONFIGURATION_NAME + ")");
}
ProgramRunnerUtil.executeConfiguration(project, outputSettings, environment.getExecutor());
}
示例4: processTerminated
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void processTerminated( ProcessEvent event )
{
super.processTerminated( event );
int exitCode = event.getExitCode();
if( exitCode == EQUINOX_RESTART_EXIT_CODE )
{
ApplicationManager.getApplication().runReadAction( new Runnable()
{
@Override
public void run()
{
ProgramRunnerUtil.executeConfiguration( appModule.getProject(),
environment.getRunnerAndConfigurationSettings(), executor );
}
} );
}
}
示例5: executeDebugRunner
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
/**
* Run tests for given element
*
* @param psiElement Elements are PhpClass or Method possible context
*/
public static void executeDebugRunner(@NotNull PsiElement psiElement) {
ConfigurationFromContext context = RunConfigurationProducer.getInstance(BehatRuntimeConfigurationProducer.class)
.createConfigurationFromContext(new ConfigurationContext(psiElement));
if(context != null) {
ProgramRunnerUtil.executeConfiguration(
psiElement.getProject(),
context.getConfigurationSettings(),
DefaultDebugExecutor.getDebugExecutorInstance()
);
}
}
示例6: doDeploy
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public void doDeploy(Executor executor) {
DeploymentTask<?> deploymentTask = getDeployment().getDeploymentTask();
if (deploymentTask != null) {
ExecutionEnvironment environment = ((DeploymentTaskImpl)deploymentTask).getExecutionEnvironment();
RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
if (settings != null) {
ProgramRunnerUtil.executeConfiguration(doGetProject(), settings, executor);
}
}
}
示例7: handleDoubleClickOrEnter
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
final Project project = getExternalProjectsView().getProject();
ProgramRunnerUtil.executeConfiguration(project, mySettings, DefaultRunExecutor.getRunExecutorInstance());
final RunManagerEx runManagerEx = RunManagerEx.getInstanceEx(project);
runManagerEx.setSelectedConfiguration(mySettings);
}
示例8: suggestRunActionName
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public static String suggestRunActionName(final LocatableConfiguration configuration) {
if (configuration instanceof LocatableConfigurationBase && configuration.isGeneratedName()) {
String actionName = ((LocatableConfigurationBase)configuration).getActionName();
if (actionName != null) {
return actionName;
}
}
return ProgramRunnerUtil.shortenName(configuration.getName(), 0);
}
示例9: executeTests
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
protected void executeTests(@NotNull final Project project,
@NotNull final VirtualFile virtualFile,
@NotNull final VirtualFile taskDir,
@NotNull final VirtualFile testFile) {
final ConfigurationFactory factory = PythonConfigurationType.getInstance().getConfigurationFactories()[0];
final RunnerAndConfigurationSettings settings =
RunManager.getInstance(project).createRunConfiguration("test", factory);
final PythonRunConfiguration configuration = (PythonRunConfiguration)settings.getConfiguration();
configuration.setScriptName(testFile.getPath());
configuration.setWorkingDirectory(taskDir.getPath());
String taskFileName = CCProjectService.getRealTaskFileName(virtualFile.getName());
if (taskFileName == null) {
return;
}
VirtualFile userFile = taskDir.findChild(taskFileName);
if (userFile == null) {
return;
}
VirtualFile ideaDir = project.getBaseDir().findChild(".idea");
if (ideaDir == null) {
return;
}
VirtualFileManager.getInstance().refreshWithoutFileWatcher(true);
ProjectView.getInstance(project).refresh();
configuration.setScriptParameters(PathUtil.toSystemDependentName(project.getBasePath()) + " " + PathUtil.toSystemDependentName(userFile.getPath()));
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ProgramRunnerUtil.executeConfiguration(project, settings, executor);
}
示例10: actionPerformed
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
RunnerAndConfigurationSettings configurationToRun = getConfigurationToRun(project);
if (configurationToRun != null) {
ProgramRunnerUtil.executeConfiguration(project, configurationToRun, DefaultRunExecutor.getRunExecutorInstance());
}
else {
AppEngineCloudType serverType = AppEngineCloudType.getInstance();
List<RemoteServer<AppEngineServerConfiguration>> servers = RemoteServersManager.getInstance().getServers(serverType);
DeploymentConfigurationManager.getInstance(project).createAndRunConfiguration(serverType, ContainerUtil.getFirstItem(servers));
}
}
示例11: runWithConfiguration
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@NotNull
protected OSProcessHandler runWithConfiguration(RunConfiguration configuration) throws ExecutionException {
final PantsJUnitRunnerAndConfigurationSettings runnerAndConfigurationSettings =
new PantsJUnitRunnerAndConfigurationSettings(configuration);
final ExecutionEnvironmentBuilder environmentBuilder =
ExecutionUtil.createEnvironment(DefaultRunExecutor.getRunExecutorInstance(), runnerAndConfigurationSettings);
final ExecutionEnvironment environment = environmentBuilder.build();
ProgramRunnerUtil.executeConfiguration(environment, false, false);
final OSProcessHandler handler = (OSProcessHandler) environment.getContentToReuse().getProcessHandler();
assertTrue(handler.waitFor());
return handler;
}
示例12: actionPerformed
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent e) {
ProgramRunnerUtil.executeConfiguration(getProject(e), myConfigurationSettings, DefaultRunExecutor.getRunExecutorInstance());
}
示例13: RunConfigurationNode
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public RunConfigurationNode(RunConfigurationsNode parent, RunnerAndConfigurationSettings settings) {
super(parent);
mySettings = settings;
setUniformIcon(ProgramRunnerUtil.getConfigurationIcon(settings, false));
}
示例14: handleDoubleClickOrEnter
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
ProgramRunnerUtil.executeConfiguration(myProject, mySettings, DefaultRunExecutor.getRunExecutorInstance());
}
示例15: onBreakpointListChanged
import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void onBreakpointListChanged(final CloudDebugProcessState state) {
SwingUtilities.invokeLater(
new Runnable() {
@Override
public void run() {
NotificationGroup notificationGroup =
NotificationGroup.balloonGroup("Cloud Debugger watcher");
String message =
GctBundle.getString(
"clouddebug.balloonnotification.message", state.getProjectName());
UsageTrackerProvider.getInstance()
.trackEvent(GctTracking.CLOUD_DEBUGGER_NOTIFY_BREAKPOINT_LIST_CHANGE)
.ping();
notificationGroup
.createNotification(
"",
message,
NotificationType.INFORMATION,
new NotificationListener() {
@Override
public void hyperlinkUpdate(
@NotNull Notification notification, @NotNull HyperlinkEvent event) {
notification.expire();
RunnerAndConfigurationSettings targetConfig = null;
RunManager manager = RunManager.getInstance(state.getProject());
for (final RunnerAndConfigurationSettings config :
manager.getAllSettings()) {
if (config.getConfiguration() instanceof CloudDebugRunConfiguration
&& ((CloudDebugRunConfiguration) config.getConfiguration())
.getProcessState()
== state) {
targetConfig = config;
}
}
if (targetConfig != null) {
Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();
ProgramRunnerUtil.executeConfiguration(
state.getProject(), targetConfig, executor);
}
}
})
.notify(state.getProject());
}
});
}