Search in sources :

Example 1 with ProjectInspectionToolsConfigurable

use of com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable in project intellij-community by JetBrains.

the class EditCleanupProfileIntentionAction method invoke.

@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    final ProjectInspectionProfileManager profileManager = ProjectInspectionProfileManager.getInstance(project);
    final ProjectInspectionToolsConfigurable configurable = new ProjectInspectionToolsConfigurable(profileManager) {

        @Override
        protected boolean acceptTool(InspectionToolWrapper entry) {
            return super.acceptTool(entry) && entry.isCleanupTool();
        }

        @Override
        public String getDisplayName() {
            return CodeCleanupAction.CODE_CLEANUP_INSPECTIONS_DISPLAY_NAME;
        }
    };
    ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
}
Also used : ProjectInspectionToolsConfigurable(com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable) ProjectInspectionProfileManager(com.intellij.profile.codeInspection.ProjectInspectionProfileManager) InspectionToolWrapper(com.intellij.codeInspection.ex.InspectionToolWrapper)

Example 2 with ProjectInspectionToolsConfigurable

use of com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable in project intellij-community by JetBrains.

the class EditInspectionToolsSettingsAction method editSettings.

public static boolean editSettings(final Project project, final InspectionProfileImpl inspectionProfile, final Consumer<ErrorsConfigurable> configurableAction) {
    final ShowSettingsUtil settingsUtil = ShowSettingsUtil.getInstance();
    final ErrorsConfigurable errorsConfigurable = new ProjectInspectionToolsConfigurable(ProjectInspectionProfileManager.getInstance(project)) {

        @Override
        protected boolean setActiveProfileAsDefaultOnApply() {
            return false;
        }

        @Override
        protected InspectionProfileImpl getCurrentProfile() {
            return inspectionProfile;
        }
    };
    return settingsUtil.editConfigurable(project, errorsConfigurable, () -> configurableAction.accept(errorsConfigurable));
}
Also used : ShowSettingsUtil(com.intellij.openapi.options.ShowSettingsUtil) ErrorsConfigurable(com.intellij.profile.codeInspection.ui.ErrorsConfigurable) ProjectInspectionToolsConfigurable(com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable)

Aggregations

ProjectInspectionToolsConfigurable (com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable)2 InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)1 ShowSettingsUtil (com.intellij.openapi.options.ShowSettingsUtil)1 ProjectInspectionProfileManager (com.intellij.profile.codeInspection.ProjectInspectionProfileManager)1 ErrorsConfigurable (com.intellij.profile.codeInspection.ui.ErrorsConfigurable)1