当前位置: 首页>>代码示例>>Java>>正文


Java RunDialog类代码示例

本文整理汇总了Java中com.intellij.execution.impl.RunDialog的典型用法代码示例。如果您正苦于以下问题:Java RunDialog类的具体用法?Java RunDialog怎么用?Java RunDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RunDialog类属于com.intellij.execution.impl包,在下文中一共展示了RunDialog类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DeploymentConfigurationManagerImpl.java

示例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");
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ServersTreeStructure.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ChooseRunConfigurationPopup.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:CreateAction.java

示例5: registerDataProvider

import com.intellij.execution.impl.RunDialog; //导入依赖的package包/类
private void registerDataProvider(JPanel panel, final Project project) {
  DataManager.registerDataProvider(panel, new DataProvider() {
    @Nullable
    @Override
    public Object getData(@NonNls String dataId) {
      final Object value = myList.getSelectedValue();
      if (CommonDataKeys.PSI_ELEMENT.is(dataId) && value instanceof PsiElement) {
        return value;
      } else if (CommonDataKeys.VIRTUAL_FILE.is(dataId) && value instanceof VirtualFile) {
        return value;
      } else if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
            if (value instanceof Navigatable) return value;
            if (value instanceof ChooseRunConfigurationPopup.ItemWrapper) {
              final Object config = ((ChooseRunConfigurationPopup.ItemWrapper)value).getValue();
              if (config instanceof RunnerAndConfigurationSettings) {
                return new Navigatable() {
                  @Override
                  public void navigate(boolean requestFocus) {
                    RunDialog.editConfiguration(project, (RunnerAndConfigurationSettings)config, "Edit Configuration", getExecutor());
                  }

                  @Override
                  public boolean canNavigate() {
                    return true;
                  }

                  @Override
                  public boolean canNavigateToSource() {
                    return true;
                  }
                };
              }
            }
      } else if (PlatformDataKeys.SEARCH_INPUT_TEXT.is(dataId)) {
        return myPopupField == null ? null : myPopupField.getText();
      }
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:SearchEverywhereAction.java

示例6: 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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:AntExplorer.java

示例7: 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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:CreateAction.java

示例8: 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");
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ServersTreeStructure.java

示例9: 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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ChooseRunConfigurationPopup.java

示例10: 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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:59,代码来源:ProgramRunnerUtil.java

示例11: 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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:53,代码来源:ProgramRunnerUtil.java

示例12: 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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:59,代码来源:ProgramRunnerUtil.java

示例13: registerDataProvider

import com.intellij.execution.impl.RunDialog; //导入依赖的package包/类
private void registerDataProvider(JPanel panel, final Project project) {
  DataManager.registerDataProvider(panel, new DataProvider() {
    @Nullable
    @Override
    public Object getData(@Nonnull @NonNls Key<?> dataId) {
      final Object value = myList.getSelectedValue();
      if (CommonDataKeys.PSI_ELEMENT == dataId && value instanceof PsiElement) {
        return value;
      }
      else if (CommonDataKeys.VIRTUAL_FILE == dataId && value instanceof VirtualFile) {
        return value;
      }
      else if (CommonDataKeys.NAVIGATABLE == dataId) {
        if (value instanceof Navigatable) return value;
        if (value instanceof ChooseRunConfigurationPopup.ItemWrapper) {
          final Object config = ((ChooseRunConfigurationPopup.ItemWrapper)value).getValue();
          if (config instanceof RunnerAndConfigurationSettings) {
            return new Navigatable() {
              @Override
              public void navigate(boolean requestFocus) {
                RunDialog.editConfiguration(project, (RunnerAndConfigurationSettings)config, "Edit Configuration", getExecutor());
              }

              @Override
              public boolean canNavigate() {
                return true;
              }

              @Override
              public boolean canNavigateToSource() {
                return true;
              }
            };
          }
        }
      }
      else if (PlatformDataKeys.SEARCH_INPUT_TEXT == dataId) {
        return myPopupField == null ? null : myPopupField.getText();
      }
      return null;
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:44,代码来源:SearchEverywhereAction.java


注:本文中的com.intellij.execution.impl.RunDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。