unused declaration: remove problems count from view (IDEA-160870)

This commit is contained in:
Anna Kozlova
2016-09-07 14:55:16 +03:00
parent 62b7a6528e
commit e1dfe30b59
3 changed files with 10 additions and 1 deletions
@@ -684,4 +684,9 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
SingleInspectionProfilePanel.readHTML(htmlView, SingleInspectionProfilePanel.toHTML(htmlView, text, false));
return ScrollPaneFactory.createScrollPane(htmlView, true);
}
@Override
public int getProblemsCount(InspectionTree tree) {
return 0;
}
}
@@ -114,4 +114,8 @@ public interface InspectionToolPresentation extends ProblemDescriptionsProcessor
default boolean isDummy() {
return false;
}
default int getProblemsCount(InspectionTree tree) {
return tree.getSelectedDescriptors().length;
}
}
@@ -82,7 +82,7 @@ public class QuickFixPreviewPanelFactory {
setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
boolean hasComponents = false;
final int actualProblemCount = myView.getTree().getSelectedDescriptors().length;
final int actualProblemCount = myView.getTree().getContext().getPresentation(myWrapper).getProblemsCount(myView.getTree());
if (actualProblemCount > 1 || (actualProblemCount == 1 && problemCount > 1)) {
add(getLabel(actualProblemCount));
hasComponents = true;