use of com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeComparator in project intellij-community by JetBrains.
the class SingleInspectionProfilePanel method fillTreeData.
private void fillTreeData(@Nullable String filter, boolean forceInclude) {
if (myProfile == null)
return;
myRoot.removeAllChildren();
myRoot.dropCache();
List<Set<String>> keySetList = new ArrayList<>();
final Set<String> quoted = new HashSet<>();
if (filter != null && !filter.isEmpty()) {
keySetList.addAll(SearchUtil.findKeys(filter, quoted));
}
Project project = myProjectProfileManager.getProject();
final boolean emptyFilter = myInspectionsFilter.isEmptyFilter();
for (ToolDescriptors toolDescriptors : myInitialToolDescriptors.values()) {
final Descriptor descriptor = toolDescriptors.getDefaultDescriptor();
if (filter != null && !filter.isEmpty() && !isDescriptorAccepted(descriptor, filter, forceInclude, keySetList, quoted)) {
continue;
}
final InspectionConfigTreeNode node = new InspectionConfigTreeNode.Tool(toolDescriptors.getDefaultDescriptor().getKey(), this);
if (!emptyFilter && !myInspectionsFilter.matches(myProfile.getTools(toolDescriptors.getDefaultDescriptor().getKey().toString(), project), node)) {
continue;
}
getGroupNode(myRoot, toolDescriptors.getDefaultDescriptor().getGroup()).add(node);
myRoot.dropCache();
}
if (filter != null && forceInclude && myRoot.getChildCount() == 0) {
final Set<String> filters = SearchableOptionsRegistrar.getInstance().getProcessedWords(filter);
if (filters.size() > 1 || !quoted.isEmpty()) {
fillTreeData(filter, false);
}
}
TreeUtil.sortRecursively(myRoot, new InspectionsConfigTreeComparator());
}
Aggregations