void (@Nullable Object target, @NotNull Charset t, @NotNull ColoredTextContainer renderer) { VirtualFile file = target instanceof VirtualFile ? (VirtualFile)target : null; EncodingUtil.FailReason result = file == null || file.isDirectory() ? null : EncodingUtil.checkCanConvertAndReload(file); @NlsSafe String encodingText = t.displayName(); SimpleTextAttributes attributes = result == null ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.GRAY_ATTRIBUTES; renderer.append(encodingText + (result == null ? "" : " (" + EncodingUtil.reasonToString(result, file) + ")"), attributes); }