HtmlChunk (@NotNull InspectionProfileEntry inspection, ModUpdateInspectionOptions.@NotNull ModifiedInspectionOption option) { OptPane pane = inspection.getOptionsPane(); Object newValue = option.newValue(); if (newValue instanceof Boolean value) { OptCheckbox control = ObjectUtils.tryCast(pane.findControl(option.bindId()), OptCheckbox.class); if (control == null) return HtmlChunk.empty(); HtmlChunk label = text(control.label().label()); HtmlChunk.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 HtmlBuilder().append(value ? AnalysisBundle.message("set.inspection.option.description.check") : AnalysisBundle.message("set.inspection.option.description.uncheck")) .br().br().append(info).toFragment(); } if (newValue instanceof Integer value) { OptNumber control = ObjectUtils.tryCast(pane.findControl(option.bindId()), OptNumber.class); if (control == null) return HtmlChunk.empty(); LocMessage.PrefixSuffix prefixSuffix = control.splitLabel().splitLabel(); HtmlChunk.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 HtmlBuilder().append(AnalysisBundle.message("set.inspection.option.description.input")) .br().br().append(info).br().toFragment(); } if (newValue instanceof List<?> list) { OptStringList control = ObjectUtils.tryCast(pane.findControl(option.bindId()), OptStringList.class); if (control == null) return HtmlChunk.empty(); List<?> oldList = (List<?>)option.oldValue(); //noinspection unchecked return IntentionPreviewInfo.addListOption((List<String>)list, control.label().label(), value -> !oldList.contains(value)).content(); } throw new IllegalStateException("Value of type " + newValue.getClass() + " is not supported"); }