IntentionPreviewInfo (@NotNull Project project, @Nullable Editor editor, @NotNull PsiFile file) { InspectionToolWrapper<?, ?> tool = InspectionProfileManager.getInstance(project).getCurrentProfile().getInspectionTool(myShortName, file); if (tool == null) return IntentionPreviewInfo.EMPTY; InspectionProfileEntry inspection = getLocalTool(tool); OptPane pane = inspection.getOptionsPane(); if (myValue instanceof Boolean value) { OptCheckbox control = ObjectUtils.tryCast(pane.findControl(myProperty), OptCheckbox.class); if (control == null) return IntentionPreviewInfo.EMPTY; HtmlChunk label = text(control.label().label()); Element checkbox = tag("input").attr("type", "checkbox").attr("readonly", "true"); if (value) { checkbox = checkbox.attr("checked", "true"); } HtmlChunk info = tag("table") .child(tag("tr").children( tag("td").child(checkbox), tag("td").child(label) )); return new IntentionPreviewInfo.Html( new HtmlBuilder().append(value ? AnalysisBundle.message("set.inspection.option.description.check") : AnalysisBundle.message("set.inspection.option.description.uncheck")) .br().br().append(info).toFragment()); } else if (myValue instanceof Integer value) { OptNumber control = ObjectUtils.tryCast(pane.findControl(myProperty), OptNumber.class); if (control == null) return IntentionPreviewInfo.EMPTY; LocMessage.PrefixSuffix prefixSuffix = control.splitLabel().splitLabel(); Element input = tag("input").attr("type", "text").attr("value", value) .attr("size", value.toString().length() + 1).attr("readonly", "true"); HtmlChunk info = tag("table").child(tag("tr").children( tag("td").child(text(prefixSuffix.prefix())), tag("td").child(input), tag("td").child(text(prefixSuffix.suffix())) )); return new IntentionPreviewInfo.Html( new HtmlBuilder().append(AnalysisBundle.message("set.inspection.option.description.input")) .br().br().append(info).br().toFragment()); } else { throw new IllegalStateException("Value of type " + myValue.getClass() + " is not supported"); } }