[codeInspection] Use a record in place of Pair<@NotNull ActionGroup, @NotNull String>

IJ-CR-117041

GitOrigin-RevId: f6b4b6c5a1e4bb60b09c8f0acdf8bc9b5197e2b9
This commit is contained in:
Louis Vignier
2023-12-05 18:42:48 +01:00
committed by intellij-monorepo-bot
parent f5e86111a0
commit 44c3fa1d67
4 changed files with 9 additions and 12 deletions

View File

@@ -3,14 +3,12 @@ package org.intellij.lang.regexp.inspection.custom;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.codeInspection.ex.InspectionProfileModifiableModel;
import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NlsActions;
import com.intellij.openapi.util.Pair;
import com.intellij.profile.codeInspection.ui.InspectionMetaDataDialog;
import com.intellij.profile.codeInspection.ui.InspectionProfileActionProvider;
import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
@@ -20,12 +18,12 @@ import org.jetbrains.annotations.Nullable;
public class RegExpProfileActionProvider extends InspectionProfileActionProvider {
@Override
public @Nullable Pair<@NotNull ActionGroup, @NotNull String> getAddActions(@NotNull SingleInspectionProfilePanel panel) {
public @Nullable AddInspectionActionGroup getAddActions(@NotNull SingleInspectionProfilePanel panel) {
final var group = new DefaultActionGroup(
new AddCustomRegExpInspectionAction(panel, RegExpBundle.message("action.add.regexp.search.inspection.text"), false),
new AddCustomRegExpInspectionAction(panel, RegExpBundle.message("action.add.regexp.replace.inspection.text"), true)
);
return Pair.create(group, "regexp.profile.action.provider.add.group");
return new AddInspectionActionGroup(group, "regexp.profile.action.provider.add.group");
}
static final class AddCustomRegExpInspectionAction extends DumbAwareAction {