Search in sources :

Example 6 with HighlightDisplayLevel

use of com.intellij.codeHighlighting.HighlightDisplayLevel in project intellij-community by JetBrains.

the class LightInspectionTestCase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    for (String environmentClass : getEnvironmentClasses()) {
        myFixture.addClass(environmentClass);
    }
    final InspectionProfileEntry inspection = getInspection();
    if (inspection != null) {
        myFixture.enableInspections(inspection);
        final Project project = myFixture.getProject();
        final HighlightDisplayKey displayKey = HighlightDisplayKey.find(inspection.getShortName());
        final InspectionProfileImpl currentProfile = ProjectInspectionProfileManager.getInstance(project).getCurrentProfile();
        final HighlightDisplayLevel errorLevel = currentProfile.getErrorLevel(displayKey, null);
        if (errorLevel == HighlightDisplayLevel.DO_NOT_SHOW) {
            currentProfile.setErrorLevel(displayKey, HighlightDisplayLevel.WARNING, project);
        }
    }
    Sdk sdk = ModuleRootManager.getInstance(ModuleManager.getInstance(getProject()).getModules()[0]).getSdk();
    if (JAVA_1_7.getSdk().getName().equals(sdk == null ? null : sdk.getName())) {
        PsiClass object = JavaPsiFacade.getInstance(getProject()).findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
        assertNotNull(object);
        PsiClass component = JavaPsiFacade.getInstance(getProject()).findClass("java.awt.Component", GlobalSearchScope.allScope(getProject()));
        assertNotNull(component);
    }
}
Also used : Project(com.intellij.openapi.project.Project) InspectionProfileImpl(com.intellij.codeInspection.ex.InspectionProfileImpl) HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) HighlightDisplayKey(com.intellij.codeInsight.daemon.HighlightDisplayKey) PsiClass(com.intellij.psi.PsiClass) InspectionProfileEntry(com.intellij.codeInspection.InspectionProfileEntry) Sdk(com.intellij.openapi.projectRoots.Sdk)

Example 7 with HighlightDisplayLevel

use of com.intellij.codeHighlighting.HighlightDisplayLevel in project intellij-community by JetBrains.

the class InspectionProfileConvertor method processElement.

protected boolean processElement(final Element option, final String name) {
    if (name.equals(DISPLAY_LEVEL_MAP_OPTION)) {
        for (Element e : option.getChild(VALUE_ATT).getChildren()) {
            String key = e.getName();
            String levelName = e.getAttributeValue(LEVEL_ATT);
            HighlightSeverity severity = myManager.getSeverityRegistrar().getSeverity(levelName);
            HighlightDisplayLevel level = severity == null ? null : HighlightDisplayLevel.find(severity);
            if (level == null)
                continue;
            myDisplayLevelMap.put(key, level);
        }
        return true;
    }
    return false;
}
Also used : HighlightSeverity(com.intellij.lang.annotation.HighlightSeverity) HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) Element(org.jdom.Element)

Example 8 with HighlightDisplayLevel

use of com.intellij.codeHighlighting.HighlightDisplayLevel in project intellij-community by JetBrains.

the class InspectionProfileConvertor method fillErrorLevels.

protected void fillErrorLevels(final InspectionProfileImpl profile) {
    //noinspection ConstantConditions
    LOG.assertTrue(profile.getInspectionTools(null) != null, "Profile was not correctly init");
    //fill error levels
    for (final String shortName : myDisplayLevelMap.keySet()) {
        //key <-> short name
        HighlightDisplayLevel level = myDisplayLevelMap.get(shortName);
        HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
        if (key == null)
            continue;
        //set up tools for default profile
        if (level != HighlightDisplayLevel.DO_NOT_SHOW) {
            profile.enableTool(shortName, null);
        }
        if (level == null || level == HighlightDisplayLevel.DO_NOT_SHOW) {
            level = HighlightDisplayLevel.WARNING;
        }
        profile.setErrorLevel(key, level, null);
    }
}
Also used : HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel)

Example 9 with HighlightDisplayLevel

use of com.intellij.codeHighlighting.HighlightDisplayLevel in project android by JetBrains.

the class AndroidLintInspectionToolProviderTest method checkAllLintChecksRegistered.

@SuppressWarnings("deprecation")
public static boolean checkAllLintChecksRegistered(Project project) throws Exception {
    if (ourDone) {
        return true;
    }
    ourDone = true;
    // For some reason, I can't just use
    //   AndroidLintInspectionBase.getInspectionShortNameByIssue
    // to iterate the available inspections from unit tests; at runtime this will enumerate all
    // the available inspections, but from unit tests (even when extending IdeaTestCase) it's empty.
    // So instead we take advantage of the knowledge that all our inspections are named in a particular
    // way from the lint issue id's, so we can use reflection to find the classes.
    // This won't catch cases if we declare a class there and forget to register in the plugin, but
    // it's better than nothing.
    Set<String> registered = Sets.newHashSetWithExpectedSize(200);
    Set<Issue> quickfixes = Sets.newLinkedHashSetWithExpectedSize(200);
    final LintIdeIssueRegistry fullRegistry = new LintIdeIssueRegistry();
    List<Issue> allIssues = fullRegistry.getIssues();
    for (Issue issue : allIssues) {
        if (!isRelevant(issue)) {
            continue;
        }
        String className = "com.android.tools.idea.lint.AndroidLint" + issue.getId() + "Inspection";
        try {
            Class<?> c = Class.forName(className);
            if (AndroidLintInspectionBase.class.isAssignableFrom(c) && ((c.getModifiers() & Modifier.ABSTRACT) == 0)) {
                AndroidLintInspectionBase provider = (AndroidLintInspectionBase) c.newInstance();
                registered.add(provider.getIssue().getId());
                boolean hasQuickFix = true;
                try {
                    provider.getClass().getDeclaredMethod("getQuickFixes", String.class);
                } catch (NoSuchMethodException e1) {
                    try {
                        provider.getClass().getDeclaredMethod("getQuickFixes", PsiElement.class, PsiElement.class, String.class);
                    } catch (NoSuchMethodException e2) {
                        hasQuickFix = false;
                    }
                }
                if (hasQuickFix) {
                    quickfixes.add(provider.getIssue());
                }
            }
        } catch (ClassNotFoundException ignore) {
        }
    }
    final List<Issue> missing = new ArrayList<>();
    for (Issue issue : allIssues) {
        if (!isRelevant(issue) || registered.contains(issue.getId())) {
            continue;
        }
        // When enabled, adjust this to register class based registrations
        assertFalse(LintIdeProject.SUPPORT_CLASS_FILES);
        Implementation implementation = issue.getImplementation();
        if (implementation.getScope().contains(Scope.CLASS_FILE) || implementation.getScope().contains(Scope.ALL_CLASS_FILES) || implementation.getScope().contains(Scope.JAVA_LIBRARIES)) {
            boolean isOk = false;
            for (EnumSet<Scope> analysisScope : implementation.getAnalysisScopes()) {
                if (!analysisScope.contains(Scope.CLASS_FILE) && !analysisScope.contains(Scope.ALL_CLASS_FILES) && !analysisScope.contains(Scope.JAVA_LIBRARIES)) {
                    isOk = true;
                    break;
                }
            }
            if (!isOk) {
                System.out.println("Skipping issue " + issue + " because it requires classfile analysis. Consider rewriting in IDEA.");
                continue;
            }
        }
        final String inspectionShortName = AndroidLintInspectionBase.getInspectionShortNameByIssue(project, issue);
        if (inspectionShortName == null) {
            missing.add(issue);
            continue;
        }
        // ELSE: compare severity, enabledByDefault, etc, message, etc
        final HighlightDisplayKey key = HighlightDisplayKey.find(inspectionShortName);
        if (key == null) {
            //fail("No highlight display key for inspection " + inspectionShortName + " for issue " + issue);
            System.out.println("No highlight display key for inspection " + inspectionShortName + " for issue " + issue);
            continue;
        }
        final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
        HighlightDisplayLevel errorLevel = profile.getErrorLevel(key, null);
        Severity s;
        if (errorLevel == HighlightDisplayLevel.WARNING || errorLevel == HighlightDisplayLevel.WEAK_WARNING) {
            s = Severity.WARNING;
        } else if (errorLevel == HighlightDisplayLevel.ERROR || errorLevel == HighlightDisplayLevel.NON_SWITCHABLE_ERROR) {
            s = Severity.ERROR;
        } else if (errorLevel == HighlightDisplayLevel.DO_NOT_SHOW) {
            s = Severity.IGNORE;
        } else if (errorLevel == HighlightDisplayLevel.INFO) {
            s = Severity.INFORMATIONAL;
        } else {
            //fail("Unexpected error level " + errorLevel);
            System.out.println("Unexpected error level " + errorLevel);
            continue;
        }
        Severity expectedSeverity = issue.getDefaultSeverity();
        if (expectedSeverity == Severity.FATAL) {
            expectedSeverity = Severity.ERROR;
        }
        if (expectedSeverity != s) {
            System.out.println("Wrong severity for " + issue + "; expected " + expectedSeverity + ", got " + s);
        }
    }
    // Spit out registration information for the missing elements
    if (!missing.isEmpty()) {
        missing.sort((issue1, issue2) -> String.CASE_INSENSITIVE_ORDER.compare(issue1.getId(), issue2.getId()));
        StringBuilder sb = new StringBuilder(1000);
        sb.append("Missing registration for ").append(missing.size()).append(" issues (out of a total issue count of ").append(allIssues.size()).append(")");
        sb.append("\nAdd to android/src/META-INF/android-plugin.xml (and please try to preserve the case insensitive alphabetical order):\n");
        for (Issue issue : missing) {
            sb.append("    <globalInspection hasStaticDescription=\"true\" shortName=\"");
            sb.append(LINT_INSPECTION_PREFIX);
            String id = issue.getId();
            sb.append(id);
            sb.append("\" displayName=\"");
            sb.append(XmlUtils.toXmlAttributeValue(issue.getBriefDescription(TextFormat.TEXT)));
            sb.append("\" groupKey=\"").append(getCategoryBundleKey(issue.getCategory())).append("\" bundle=\"messages.AndroidBundle\" enabledByDefault=\"");
            sb.append(issue.isEnabledByDefault());
            sb.append("\" level=\"");
            sb.append(issue.getDefaultSeverity() == Severity.ERROR || issue.getDefaultSeverity() == Severity.FATAL ? "ERROR" : issue.getDefaultSeverity() == Severity.WARNING ? "WARNING" : "INFO");
            sb.append("\" implementationClass=\"com.android.tools.idea.lint.AndroidLint");
            sb.append(id);
            sb.append("Inspection\"/>\n");
        }
        sb.append("\nAdd to com.android.tools.idea.lint:\n");
        for (Issue issue : missing) {
            String id = issue.getId();
            String detectorClass = getDetectorClass(issue).getName();
            String detectorName = getDetectorClass(issue).getSimpleName();
            String issueName = getIssueFieldName(issue);
            String messageKey = getMessageKey(issue);
            //noinspection StringConcatenationInsideStringBufferAppend
            sb.append("/*\n" + " * Copyright (C) 2016 The Android Open Source Project\n" + " *\n" + " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" + " * you may not use this file except in compliance with the License.\n" + " * You may obtain a copy of the License at\n" + " *\n" + " *      http://www.apache.org/licenses/LICENSE-2.0\n" + " *\n" + " * Unless required by applicable law or agreed to in writing, software\n" + " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" + " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + " * See the License for the specific language governing permissions and\n" + " * limitations under the License.\n" + " */\n" + "package com.android.tools.idea.lint;\n" + "\n" + "import " + detectorClass + ";\n" + "import org.jetbrains.android.inspections.lint.AndroidLintInspectionBase;\n" + "import org.jetbrains.android.util.AndroidBundle;\n" + "\n" + "public class AndroidLint" + id + "Inspection extends AndroidLintInspectionBase {\n" + "  public AndroidLint" + id + "Inspection() {\n" + "    super(AndroidBundle.message(\"android.lint.inspections." + messageKey + "\"), " + detectorName + "." + issueName + ");\n" + "  }\n" + "}\n");
        }
        sb.append("\nAdd to AndroidBundle.properties:\n");
        for (Issue issue : missing) {
            String messageKey = getMessageKey(issue);
            sb.append("android.lint.inspections.").append(messageKey).append("=").append(escapePropertyValue(getBriefDescription(issue))).append("\n");
        }
        sb.append("\nAdded registrations for ").append(missing.size()).append(" issues (out of a total issue count of ").append(allIssues.size()).append(")\n");
        System.out.println("*IF* necessary, add these category descriptors to AndroidBundle.properties:\n");
        Set<Category> categories = Sets.newHashSet();
        for (Issue issue : missing) {
            categories.add(issue.getCategory());
        }
        List<Category> sorted = Lists.newArrayList(categories);
        Collections.sort(sorted);
        for (Category category : sorted) {
            sb.append(getCategoryBundleKey(category)).append('=').append(escapePropertyValue(("Android > Lint > " + category.getFullName()).replace(":", " > "))).append("\n");
        }
        System.out.println(sb.toString());
        return false;
    } else if (LIST_ISSUES_WITH_QUICK_FIXES) {
        System.out.println("The following inspections have quickfixes (used for Reporter.java):\n");
        List<String> fields = Lists.newArrayListWithExpectedSize(quickfixes.size());
        Set<String> imports = Sets.newHashSetWithExpectedSize(quickfixes.size());
        // These two are handled by the ResourceTypeInspection's quickfixes; they're
        // not handled by lint per se, but on the command line (in HTML reports) they're
        // flagged by lint, so include them in the list
        quickfixes.add(SupportAnnotationDetector.CHECK_PERMISSION);
        quickfixes.add(SupportAnnotationDetector.MISSING_PERMISSION);
        quickfixes.add(SupportAnnotationDetector.CHECK_RESULT);
        for (Issue issue : quickfixes) {
            String detectorName = getDetectorClass(issue).getName();
            imports.add(detectorName);
            int index = detectorName.lastIndexOf('.');
            if (index != -1) {
                detectorName = detectorName.substring(index + 1);
            }
            String issueName = getIssueFieldName(issue);
            fields.add(detectorName + "." + issueName);
        }
        Collections.sort(fields);
        List<String> sortedImports = Lists.newArrayList(imports);
        Collections.sort(sortedImports);
        for (String cls : sortedImports) {
            System.out.println("import " + cls + ";");
        }
        System.out.println();
        System.out.println("sStudioFixes = Sets.newHashSet(\n    " + Joiner.on(",\n    ").join(fields) + "\n);\n");
    }
    return true;
}
Also used : HighlightDisplayKey(com.intellij.codeInsight.daemon.HighlightDisplayKey) PsiElement(com.intellij.psi.PsiElement) HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) InspectionProfile(com.intellij.codeInspection.InspectionProfile)

Example 10 with HighlightDisplayLevel

use of com.intellij.codeHighlighting.HighlightDisplayLevel in project intellij-community by JetBrains.

the class SingleInspectionProfilePanel method updateOptionsAndDescriptionPanel.

private void updateOptionsAndDescriptionPanel(final TreePath... paths) {
    if (myProfile == null || paths == null || paths.length == 0) {
        return;
    }
    final TreePath path = paths[0];
    if (path == null)
        return;
    final List<InspectionConfigTreeNode> nodes = InspectionsAggregationUtil.getInspectionsNodes(paths);
    if (!nodes.isEmpty()) {
        final InspectionConfigTreeNode singleNode = paths.length == 1 && ((InspectionConfigTreeNode) paths[0].getLastPathComponent()).getDefaultDescriptor() != null ? ContainerUtil.getFirstItem(nodes) : null;
        if (singleNode != null) {
            final Descriptor descriptor = singleNode.getDefaultDescriptor();
            LOG.assertTrue(descriptor != null);
            if (descriptor.loadDescription() != null) {
                // need this in order to correctly load plugin-supplied descriptions
                final Descriptor defaultDescriptor = singleNode.getDefaultDescriptor();
                final String description = defaultDescriptor.loadDescription();
                try {
                    if (!readHTML(myBrowser, SearchUtil.markup(toHTML(myBrowser, description, false), myProfileFilter.getFilter()))) {
                        readHTML(myBrowser, toHTML(myBrowser, "<b>" + UNDER_CONSTRUCTION + "</b>", false));
                    }
                } catch (Throwable t) {
                    LOG.error("Failed to load description for: " + defaultDescriptor.getToolWrapper().getTool().getClass() + "; description: " + description, t);
                }
            } else {
                readHTML(myBrowser, toHTML(myBrowser, "Can't find inspection description.", false));
            }
        } else {
            readHTML(myBrowser, toHTML(myBrowser, "Multiple inspections are selected. You can edit them as a single inspection.", false));
        }
        myOptionsPanel.removeAll();
        final Project project = myProjectProfileManager.getProject();
        final JPanel severityPanel = new JPanel(new GridBagLayout());
        final JPanel configPanelAnchor = new JPanel(new GridLayout());
        final Set<String> scopesNames = new THashSet<>();
        for (final InspectionConfigTreeNode node : nodes) {
            final List<ScopeToolState> nonDefaultTools = myProfile.getNonDefaultTools(node.getDefaultDescriptor().getKey().toString(), project);
            for (final ScopeToolState tool : nonDefaultTools) {
                scopesNames.add(tool.getScopeName());
            }
        }
        final double severityPanelWeightY;
        if (scopesNames.isEmpty()) {
            final LevelChooserAction severityLevelChooser = new LevelChooserAction(myProfile.getProfileManager().getOwnSeverityRegistrar(), includeDoNotShow(nodes)) {

                @Override
                protected void onChosen(final HighlightSeverity severity) {
                    final HighlightDisplayLevel level = HighlightDisplayLevel.find(severity);
                    for (final InspectionConfigTreeNode node : nodes) {
                        final HighlightDisplayKey key = node.getDefaultDescriptor().getKey();
                        final NamedScope scope = node.getDefaultDescriptor().getScope();
                        final boolean toUpdate = myProfile.getErrorLevel(key, scope, project) != level;
                        myProfile.setErrorLevel(key, level, null, project);
                        if (toUpdate)
                            node.dropCache();
                    }
                    myTreeTable.updateUI();
                }
            };
            final HighlightSeverity severity = ScopesAndSeveritiesTable.getSeverity(ContainerUtil.map(nodes, node -> node.getDefaultDescriptor().getState()));
            severityLevelChooser.setChosen(severity);
            final ScopesChooser scopesChooser = new ScopesChooser(ContainerUtil.map(nodes, node -> node.getDefaultDescriptor()), myProfile, project, null) {

                @Override
                protected void onScopesOrderChanged() {
                    myTreeTable.updateUI();
                    updateOptionsAndDescriptionPanel();
                }

                @Override
                protected void onScopeAdded() {
                    myTreeTable.updateUI();
                    updateOptionsAndDescriptionPanel();
                }
            };
            severityPanel.add(new JLabel(InspectionsBundle.message("inspection.severity")), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, JBUI.insets(10, 0), 0, 0));
            final JComponent severityLevelChooserComponent = severityLevelChooser.createCustomComponent(severityLevelChooser.getTemplatePresentation());
            severityPanel.add(severityLevelChooserComponent, new GridBagConstraints(1, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBUI.insets(10, 0), 0, 0));
            final JComponent scopesChooserComponent = scopesChooser.createCustomComponent(scopesChooser.getTemplatePresentation());
            severityPanel.add(scopesChooserComponent, new GridBagConstraints(2, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBUI.insets(10, 0), 0, 0));
            final JLabel label = new JLabel("", SwingConstants.RIGHT);
            severityPanel.add(label, new GridBagConstraints(3, 0, 1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH, JBUI.insets(2, 0), 0, 0));
            severityPanelWeightY = 0.0;
            if (singleNode != null) {
                setConfigPanel(configPanelAnchor, myProfile.getToolDefaultState(singleNode.getDefaultDescriptor().getKey().toString(), project));
            }
        } else {
            if (singleNode != null) {
                for (final Descriptor descriptor : singleNode.getDescriptors().getNonDefaultDescriptors()) {
                    descriptor.loadConfig();
                }
            }
            final JTable scopesAndScopesAndSeveritiesTable = new ScopesAndSeveritiesTable(new ScopesAndSeveritiesTable.TableSettings(nodes, myProfile, project) {

                @Override
                protected void onScopeChosen(@NotNull final ScopeToolState state) {
                    setConfigPanel(configPanelAnchor, state);
                    configPanelAnchor.revalidate();
                    configPanelAnchor.repaint();
                }

                @Override
                protected void onSettingsChanged() {
                    update(false);
                }

                @Override
                protected void onScopeAdded() {
                    update(true);
                }

                @Override
                protected void onScopesOrderChanged() {
                    update(true);
                }

                @Override
                protected void onScopeRemoved(final int scopesCount) {
                    update(scopesCount == 1);
                }

                private void update(final boolean updateOptionsAndDescriptionPanel) {
                    Queue<InspectionConfigTreeNode> q = new Queue<>(nodes.size());
                    for (InspectionConfigTreeNode node : nodes) {
                        q.addLast(node);
                    }
                    while (!q.isEmpty()) {
                        final InspectionConfigTreeNode inspectionConfigTreeNode = q.pullFirst();
                        inspectionConfigTreeNode.dropCache();
                        final TreeNode parent = inspectionConfigTreeNode.getParent();
                        if (parent != null && parent.getParent() != null) {
                            q.addLast((InspectionConfigTreeNode) parent);
                        }
                    }
                    myTreeTable.updateUI();
                    if (updateOptionsAndDescriptionPanel) {
                        updateOptionsAndDescriptionPanel();
                    }
                }
            });
            final ToolbarDecorator wrappedTable = ToolbarDecorator.createDecorator(scopesAndScopesAndSeveritiesTable).disableUpDownActions().setRemoveActionUpdater(new AnActionButtonUpdater() {

                @Override
                public boolean isEnabled(AnActionEvent e) {
                    final int selectedRow = scopesAndScopesAndSeveritiesTable.getSelectedRow();
                    final int rowCount = scopesAndScopesAndSeveritiesTable.getRowCount();
                    return rowCount - 1 != selectedRow;
                }
            });
            final JPanel panel = wrappedTable.createPanel();
            panel.setMinimumSize(new Dimension(getMinimumSize().width, 3 * scopesAndScopesAndSeveritiesTable.getRowHeight()));
            severityPanel.add(new JBLabel("Severity by Scope"), new GridBagConstraints(0, 0, 1, 1, 1.0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(5, 0, 2, 10), 0, 0));
            severityPanel.add(panel, new GridBagConstraints(0, 1, 1, 1, 0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBUI.insets(0, 0, 0, 0), 0, 0));
            severityPanelWeightY = 0.3;
        }
        myOptionsPanel.add(severityPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, severityPanelWeightY, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBUI.insets(0, 2, 0, 0), 0, 0));
        if (configPanelAnchor.getComponentCount() != 0) {
            configPanelAnchor.setBorder(IdeBorderFactory.createTitledBorder("Options", false, new JBInsets(7, 0, 0, 0)));
        }
        GuiUtils.enableChildren(myOptionsPanel, isThoughOneNodeEnabled(nodes));
        if (configPanelAnchor.getComponentCount() != 0 || scopesNames.isEmpty()) {
            myOptionsPanel.add(configPanelAnchor, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBUI.insets(0, 2, 0, 0), 0, 0));
        }
        myOptionsPanel.revalidate();
    } else {
        initOptionsAndDescriptionPanel();
    }
    myOptionsPanel.repaint();
}
Also used : JBInsets(com.intellij.util.ui.JBInsets) UIUtil(com.intellij.util.ui.UIUtil) com.intellij.codeInspection.ex(com.intellij.codeInspection.ex) AllIcons(com.intellij.icons.AllIcons) ScopesAndSeveritiesTable(com.intellij.profile.codeInspection.ui.table.ScopesAndSeveritiesTable) InspectionProfileManager(com.intellij.profile.codeInspection.InspectionProfileManager) HighlightSeverity(com.intellij.lang.annotation.HighlightSeverity) THashSet(gnu.trove.THashSet) ItemListener(java.awt.event.ItemListener) THashMap(gnu.trove.THashMap) JBLabel(com.intellij.ui.components.JBLabel) Queue(com.intellij.util.containers.Queue) JBUI(com.intellij.util.ui.JBUI) ProjectInspectionProfileManager(com.intellij.profile.codeInspection.ProjectInspectionProfileManager) Disposer(com.intellij.openapi.util.Disposer) SearchableOptionsRegistrar(com.intellij.ide.ui.search.SearchableOptionsRegistrar) Logger(com.intellij.openapi.diagnostic.Logger) InspectionsConfigTreeComparator(com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeComparator) InspectionsFilter(com.intellij.profile.codeInspection.ui.filter.InspectionsFilter) DefaultTreeModel(javax.swing.tree.DefaultTreeModel) InspectionsConfigTreeRenderer(com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeRenderer) ItemEvent(java.awt.event.ItemEvent) HintUtil(com.intellij.codeInsight.hint.HintUtil) TreePath(javax.swing.tree.TreePath) com.intellij.ide(com.intellij.ide) HighlightDisplayKey(com.intellij.codeInsight.daemon.HighlightDisplayKey) HighlightInfoType(com.intellij.codeInsight.daemon.impl.HighlightInfoType) com.intellij.ui(com.intellij.ui) SearchUtil(com.intellij.ide.ui.search.SearchUtil) BaseInspectionProfileManager(com.intellij.profile.codeInspection.BaseInspectionProfileManager) InspectionsBundle(com.intellij.codeInspection.InspectionsBundle) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) TextAttributes(com.intellij.openapi.editor.markup.TextAttributes) ApplicationManager(com.intellij.openapi.application.ApplicationManager) NotNull(org.jetbrains.annotations.NotNull) InspectionFilterAction(com.intellij.profile.codeInspection.ui.filter.InspectionFilterAction) Settings(com.intellij.openapi.options.ex.Settings) SeverityRegistrar(com.intellij.codeInsight.daemon.impl.SeverityRegistrar) java.util(java.util) TreeNode(javax.swing.tree.TreeNode) NonNls(org.jetbrains.annotations.NonNls) ContainerUtil(com.intellij.util.containers.ContainerUtil) InspectionConfigTreeNode(com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode) Comparing(com.intellij.openapi.util.Comparing) NamedScope(com.intellij.psi.search.scope.packageSet.NamedScope) JDOMUtil(com.intellij.openapi.util.JDOMUtil) Project(com.intellij.openapi.project.Project) TreeUtil(com.intellij.util.ui.tree.TreeUtil) JBCheckBox(com.intellij.ui.components.JBCheckBox) StringUtil(com.intellij.openapi.util.text.StringUtil) Convertor(com.intellij.util.containers.Convertor) javax.swing.event(javax.swing.event) IOException(java.io.IOException) HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) Disposable(com.intellij.openapi.Disposable) InspectionsConfigTreeTable(com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable) java.awt(java.awt) com.intellij.openapi.actionSystem(com.intellij.openapi.actionSystem) TextAttributesKey(com.intellij.openapi.editor.colors.TextAttributesKey) DumbAwareAction(com.intellij.openapi.project.DumbAwareAction) StringReader(java.io.StringReader) Element(org.jdom.Element) Alarm(com.intellij.util.Alarm) javax.swing(javax.swing) HighlightSeverity(com.intellij.lang.annotation.HighlightSeverity) HighlightDisplayKey(com.intellij.codeInsight.daemon.HighlightDisplayKey) JBInsets(com.intellij.util.ui.JBInsets) NamedScope(com.intellij.psi.search.scope.packageSet.NamedScope) JBLabel(com.intellij.ui.components.JBLabel) TreeNode(javax.swing.tree.TreeNode) InspectionConfigTreeNode(com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode) Queue(com.intellij.util.containers.Queue) HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) ScopesAndSeveritiesTable(com.intellij.profile.codeInspection.ui.table.ScopesAndSeveritiesTable) THashSet(gnu.trove.THashSet) InspectionConfigTreeNode(com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode) Project(com.intellij.openapi.project.Project) TreePath(javax.swing.tree.TreePath)

Aggregations

HighlightDisplayLevel (com.intellij.codeHighlighting.HighlightDisplayLevel)34 HighlightDisplayKey (com.intellij.codeInsight.daemon.HighlightDisplayKey)14 PsiElement (com.intellij.psi.PsiElement)13 Project (com.intellij.openapi.project.Project)7 Element (org.jdom.Element)6 InspectionProfileImpl (com.intellij.codeInspection.ex.InspectionProfileImpl)5 HighlightSeverity (com.intellij.lang.annotation.HighlightSeverity)5 NotNull (org.jetbrains.annotations.NotNull)5 SeverityRegistrar (com.intellij.codeInsight.daemon.impl.SeverityRegistrar)4 IntentionAction (com.intellij.codeInsight.intention.IntentionAction)4 Annotation (com.intellij.lang.annotation.Annotation)4 Issue (com.android.tools.lint.detector.api.Issue)3 InspectionProfile (com.intellij.codeInspection.InspectionProfile)3 LocalInspectionTool (com.intellij.codeInspection.LocalInspectionTool)3 NamedScope (com.intellij.psi.search.scope.packageSet.NamedScope)3 LinkedHashMap (com.intellij.util.containers.hash.LinkedHashMap)3 Nullable (org.jetbrains.annotations.Nullable)3 TextAttributesKey (com.intellij.openapi.editor.colors.TextAttributesKey)2 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)2 TextRange (com.intellij.openapi.util.TextRange)2