本文整理汇总了Java中com.intellij.execution.impl.RunDialog.editConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java RunDialog.editConfiguration方法的具体用法?Java RunDialog.editConfiguration怎么用?Java RunDialog.editConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.impl.RunDialog
的用法示例。
在下文中一共展示了RunDialog.editConfiguration方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndRunConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的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: editConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
public void editConfiguration() {
DeploymentTask<?> task = getDeployment().getDeploymentTask();
if (task != null) {
RunnerAndConfigurationSettings settings = ((DeploymentTaskImpl)task).getExecutionEnvironment().getRunnerAndConfigurationSettings();
if (settings != null) {
RunDialog.editConfiguration(doGetProject(), settings, "Edit Deployment Configuration");
}
}
}
示例3: editConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
void editConfiguration(@NotNull final Project project, @NotNull final RunnerAndConfigurationSettings configuration) {
final Executor executor = getExecutor();
PropertiesComponent.getInstance().setValue("run.configuration.edit.ad", Boolean.toString(true));
if (RunDialog.editConfiguration(project, configuration, "Edit configuration settings", executor)) {
RunManagerEx.getInstanceEx(project).setSelectedConfiguration(configuration);
ExecutionUtil.runConfiguration(configuration, executor);
}
}
示例4: perform
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
@Override
public void perform(final ConfigurationContext context) {
final RunnerAndConfigurationSettings configuration = context.getConfiguration();
if (RunDialog.editConfiguration(context.getProject(), configuration, ExecutionBundle.message("create.run.configuration.for.item.dialog.title", configuration.getName()))) {
final RunManagerImpl runManager = (RunManagerImpl)context.getRunManager();
runManager.addConfiguration(configuration,
runManager.isConfigurationShared(configuration),
runManager.getBeforeRunTasks(configuration.getConfiguration()), false);
runManager.setSelectedConfiguration(configuration);
}
}
示例5: actionPerformed
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final AntBuildFile buildFile = getCurrentBuildFile();
if (buildFile == null || !buildFile.exists()) {
return;
}
TreePath selectionPath = myTree.getSelectionPath();
if (selectionPath == null) return;
final DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
final Object userObject = node.getUserObject();
AntBuildTarget target = null;
if (userObject instanceof AntTargetNodeDescriptor) {
AntTargetNodeDescriptor targetNodeDescriptor = (AntTargetNodeDescriptor)userObject;
target = targetNodeDescriptor.getTarget();
}
else if (userObject instanceof AntBuildFileNodeDescriptor){
AntBuildModel model = ((AntBuildFileNodeDescriptor)userObject).getBuildFile().getModel();
target = model.findTarget(model.getDefaultTargetName());
}
String name = target != null ? target.getDisplayName() : null;
if (target == null || name == null) {
return;
}
RunManagerImpl runManager = (RunManagerImpl)RunManager.getInstance(e.getProject());
RunnerAndConfigurationSettings settings =
runManager.createRunConfiguration(name, AntRunConfigurationType.getInstance().getFactory());
AntRunConfiguration configuration = (AntRunConfiguration)settings.getConfiguration();
configuration.acceptSettings(target);
if (RunDialog.editConfiguration(e.getProject(), settings, ExecutionBundle
.message("create.run.configuration.for.item.dialog.title", configuration.getName()))) {
runManager.addConfiguration(settings,
runManager.isConfigurationShared(settings),
runManager.getBeforeRunTasks(settings.getConfiguration()), false);
runManager.setSelectedConfiguration(settings);
}
}
示例6: perform
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
@Override
public void perform(final ConfigurationContext context) {
final RunnerAndConfigurationSettings configuration = context.getConfiguration();
if (RunDialog.editConfiguration(context.getProject(), configuration, ExecutionBundle.message("create.run.configuration.for.item.dialog.title", configuration.getName()))) {
final RunManagerImpl runManager = (RunManagerImpl)context.getRunManager();
runManager.addConfiguration(configuration,
runManager.isConfigurationShared(configuration),
runManager.getBeforeRunTasks(configuration.getConfiguration()), false);
runManager.setActiveConfiguration(configuration);
}
}
示例7: editConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
@Override
public void editConfiguration() {
DeploymentTask<?> task = getValue().getDeploymentTask();
if (task != null) {
RunnerAndConfigurationSettings settings = ((DeploymentTaskImpl)task).getExecutionEnvironment().getRunnerAndConfigurationSettings();
if (settings != null) {
RunDialog.editConfiguration(doGetProject(), settings, "Edit Deployment Configuration");
}
}
}
示例8: editConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
void editConfiguration(@Nonnull final Project project, @Nonnull final RunnerAndConfigurationSettings configuration) {
final Executor executor = getExecutor();
PropertiesComponent.getInstance().setValue("run.configuration.edit.ad", Boolean.toString(true));
if (RunDialog.editConfiguration(project, configuration, "Edit configuration settings", executor)) {
RunManagerEx.getInstanceEx(project).setSelectedConfiguration(configuration);
ExecutionUtil.runConfiguration(configuration, executor);
}
}
示例9: executeConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
public static void executeConfiguration(@NotNull ExecutionEnvironment environment, boolean showSettings, boolean assignNewId) {
if (ExecutorRegistry.getInstance().isStarting(environment)) {
return;
}
RunnerAndConfigurationSettings runnerAndConfigurationSettings = environment.getRunnerAndConfigurationSettings();
if (runnerAndConfigurationSettings != null) {
if (!ExecutionTargetManager.canRun(environment)) {
ExecutionUtil.handleExecutionError(environment, new ExecutionException(
StringUtil.escapeXml("Cannot run '" + environment.getRunProfile().getName() + "' on '" + environment.getExecutionTarget().getDisplayName() + "'")));
return;
}
if (!RunManagerImpl.canRunConfiguration(environment) || (showSettings && runnerAndConfigurationSettings.isEditBeforeRun())) {
if (!RunDialog.editConfiguration(environment, "Edit configuration")) {
return;
}
while (!RunManagerImpl.canRunConfiguration(environment)) {
if (Messages.YES == Messages
.showYesNoDialog(environment.getProject(), "Configuration is still incorrect. Do you want to edit it again?", "Change Configuration Settings",
"Edit", "Continue Anyway", Messages.getErrorIcon())) {
if (!RunDialog.editConfiguration(environment, "Edit configuration")) {
return;
}
}
else {
break;
}
}
}
ConfigurationType configurationType = runnerAndConfigurationSettings.getType();
if (configurationType != null) {
UsageTrigger.trigger("execute." + ConvertUsagesUtil.ensureProperKey(configurationType.getId()) + "." + environment.getExecutor().getId());
}
}
try {
if (assignNewId) {
environment.assignNewExecutionId();
}
environment.getRunner().execute(environment);
}
catch (ExecutionException e) {
String name = runnerAndConfigurationSettings != null ? runnerAndConfigurationSettings.getName() : null;
if (name == null) {
name = environment.getRunProfile().getName();
}
if (name == null && environment.getContentToReuse() != null) {
name = environment.getContentToReuse().getDisplayName();
}
if (name == null) {
name = "<Unknown>";
}
ExecutionUtil.handleExecutionError(environment.getProject(), environment.getExecutor().getToolWindowId(), name, e);
}
}
示例10: executeConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
public static void executeConfiguration(@NotNull final Project project,
@NotNull final RunnerAndConfigurationSettings configuration,
@NotNull final Executor executor,
@NotNull final ExecutionTarget target,
@Nullable RunContentDescriptor contentToReuse,
final boolean showSettings) {
ProgramRunner runner = getRunner(executor.getId(), configuration);
if (runner == null) {
LOG.error("Runner MUST not be null! Cannot find runner for " + executor.getId() + " and " + configuration.getConfiguration().getFactory().getName());
return;
}
if (ExecutorRegistry.getInstance().isStarting(project, executor.getId(), runner.getRunnerId())){
return;
}
if (!ExecutionTargetManager.canRun(configuration, target)) {
ExecutionUtil.handleExecutionError(
project, executor.getToolWindowId(), configuration.getConfiguration(),
new ExecutionException(StringUtil.escapeXml("Cannot run '" + configuration.getName() + "' on '" + target.getDisplayName() + "'")));
return;
}
if (!RunManagerImpl.canRunConfiguration(configuration, executor) || (showSettings && configuration.isEditBeforeRun())) {
if (!RunDialog.editConfiguration(project, configuration, "Edit configuration", executor)) {
return;
}
while (!RunManagerImpl.canRunConfiguration(configuration, executor)) {
if (0 == Messages.showYesNoDialog(project, "Configuration is still incorrect. Do you want to edit it again?", "Change Configuration Settings",
"Edit", "Continue Anyway", Messages.getErrorIcon())) {
if (!RunDialog.editConfiguration(project, configuration, "Edit configuration", executor)) {
return;
}
} else {
break;
}
}
}
final ConfigurationType configurationType = configuration.getType();
if (configurationType != null) {
UsageTrigger.trigger("execute." + ConvertUsagesUtil.ensureProperKey(configurationType.getId()) + "." + executor.getId());
}
try {
runner.execute(new ExecutionEnvironmentBuilder(project, executor).setRunnerAndSettings(runner, configuration).setTarget(target)
.setContentToReuse(contentToReuse).assignNewId().build());
}
catch (ExecutionException e) {
ExecutionUtil.handleExecutionError(project, executor.getToolWindowId(), configuration.getConfiguration(), e);
}
}
示例11: executeConfiguration
import com.intellij.execution.impl.RunDialog; //导入方法依赖的package包/类
public static void executeConfiguration(@Nonnull ExecutionEnvironment environment, boolean showSettings, boolean assignNewId) {
if (ExecutorRegistry.getInstance().isStarting(environment)) {
return;
}
RunnerAndConfigurationSettings runnerAndConfigurationSettings = environment.getRunnerAndConfigurationSettings();
if (runnerAndConfigurationSettings != null) {
if (!ExecutionTargetManager.canRun(environment)) {
ExecutionUtil.handleExecutionError(environment, new ExecutionException(
StringUtil.escapeXml("Cannot run '" + environment.getRunProfile().getName() + "' on '" + environment.getExecutionTarget().getDisplayName() + "'")));
return;
}
if (!RunManagerImpl.canRunConfiguration(environment) || (showSettings && runnerAndConfigurationSettings.isEditBeforeRun())) {
if (!RunDialog.editConfiguration(environment, "Edit configuration")) {
return;
}
while (!RunManagerImpl.canRunConfiguration(environment)) {
if (Messages.YES == Messages
.showYesNoDialog(environment.getProject(), "Configuration is still incorrect. Do you want to edit it again?", "Change Configuration Settings",
"Edit", "Continue Anyway", Messages.getErrorIcon())) {
if (!RunDialog.editConfiguration(environment, "Edit configuration")) {
return;
}
}
else {
break;
}
}
}
ConfigurationType configurationType = runnerAndConfigurationSettings.getType();
if (configurationType != null) {
UsageTrigger.trigger("execute." + ConvertUsagesUtil.ensureProperKey(configurationType.getId()) + "." + environment.getExecutor().getId());
}
}
try {
if (assignNewId) {
environment.assignNewExecutionId();
}
environment.getRunner().execute(environment);
}
catch (ExecutionException e) {
String name = runnerAndConfigurationSettings != null ? runnerAndConfigurationSettings.getName() : null;
if (name == null) {
name = environment.getRunProfile().getName();
}
if (name == null && environment.getContentToReuse() != null) {
name = environment.getContentToReuse().getDisplayName();
}
if (name == null) {
name = "<Unknown>";
}
ExecutionUtil.handleExecutionError(environment.getProject(), environment.getExecutor().getToolWindowId(), name, e);
}
}