コード例 #1
0
  private static ExecutionException createExecutionException(
      String text,
      String textWithFix,
      @NotNull MavenGeneralSettings coreSettings,
      @Nullable Project project,
      @Nullable MavenRunConfiguration runConfiguration) {
    Project notNullProject = project;
    if (notNullProject == null) {
      if (runConfiguration == null) return new ExecutionException(text);
      notNullProject = runConfiguration.getProject();
      if (notNullProject == null) return new ExecutionException(text);
    }

    if (coreSettings == MavenProjectsManager.getInstance(notNullProject).getGeneralSettings()) {
      return new ProjectSettingsOpenerExecutionException(textWithFix, notNullProject);
    }

    if (runConfiguration != null) {
      Project runCfgProject = runConfiguration.getProject();
      if (runCfgProject != null) {
        if (((RunManagerImpl) RunManager.getInstance(runCfgProject)).getSettings(runConfiguration)
            != null) {
          return new RunConfigurationOpenerExecutionException(textWithFix, runConfiguration);
        }
      }
    }

    return new ExecutionException(text);
  }
コード例 #2
0
    @Override
    public void hyperlinkUpdate(HyperlinkEvent e) {
      if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) return;

      Project project = myRunConfiguration.getProject();
      // RunManagerImpl runManager = (RunManagerImpl)RunManager.getInstance(project);
      // RunnerAndConfigurationSettings settings = runManager.getSettings(myRunConfiguration);
      // if (settings == null) {
      //  return;
      // }
      //
      // runManager.setSelectedConfiguration(settings);

      EditConfigurationsDialog dialog = new EditConfigurationsDialog(project);
      dialog.show();
    }