@Override protected boolean dressDescription(@NotNull final Editor editor) { final List<String> problems = StringUtil.split(UIUtil.getHtmlBody(new Html(myText).setKeepFont(true)), UIUtil.BORDER_LINE); String text = ""; for (String problem : problems) { final String ref = getLinkRef(problem); if (ref != null) { String description = TooltipLinkHandlerEP.getDescription(ref, editor); if (description != null) { description = DefaultInspectionToolPresentation.stripUIRefsFromInspectionDescription(UIUtil.getHtmlBody(new Html(description).setKeepFont(true))); text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)).replace(DaemonBundle.message("inspection.extended.description"), DaemonBundle.message("inspection.collapse.description")) + END_MARKER + "<p>" + description + UIUtil.BORDER_LINE; } } else { text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)) + UIUtil.BORDER_LINE; } } if (!text.isEmpty()) { //otherwise do not change anything myText = XmlStringUtil.wrapInHtml(StringUtil.trimEnd(text, UIUtil.BORDER_LINE)); return true; } return false; }
@Override protected boolean dressDescription(@Nonnull final Editor editor) { final List<String> problems = StringUtil.split(UIUtil.getHtmlBody(new Html(myText).setKeepFont(true)), UIUtil.BORDER_LINE); String text = ""; for (String problem : problems) { final String ref = getLinkRef(problem); if (ref != null) { String description = TooltipLinkHandlerEP.getDescription(ref, editor); if (description != null) { description = DefaultInspectionToolPresentation.stripUIRefsFromInspectionDescription(UIUtil.getHtmlBody(new Html(description).setKeepFont(true))); text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)).replace(DaemonBundle.message("inspection.extended.description"), DaemonBundle.message("inspection.collapse.description")) + END_MARKER + "<p>" + description + UIUtil.BORDER_LINE; } } else { text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)) + UIUtil.BORDER_LINE; } } if (!text.isEmpty()) { //otherwise do not change anything myText = XmlStringUtil.wrapInHtml(StringUtil.trimEnd(text, UIUtil.BORDER_LINE)); return true; } return false; }
public static String prepareHintText(@NotNull Html text, @NotNull HintHint hintHint) { String htmlBody = UIUtil.getHtmlBody(text); return String.format( "<html><head>%s</head><body>%s</body></html>", UIUtil.getCssFontDeclaration(hintHint.getTextFont(), hintHint.getTextForeground(), hintHint.getLinkForeground(), hintHint.getUlImg()), htmlBody ); }
@Override protected void stripDescription() { final List<String> problems = StringUtil.split(UIUtil.getHtmlBody(new Html(myText).setKeepFont(true)), UIUtil.BORDER_LINE); myText = ""; for (String problem1 : problems) { final String problem = StringUtil.split(problem1, END_MARKER).get(0); myText += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)).replace(DaemonBundle.message("inspection.collapse.description"), DaemonBundle.message("inspection.extended.description")) + UIUtil.BORDER_LINE; } myText = XmlStringUtil.wrapInHtml(StringUtil.trimEnd(myText, UIUtil.BORDER_LINE)); }
public static String prepareHintText(@Nonnull Html text, @Nonnull HintHint hintHint) { String htmlBody = UIUtil.getHtmlBody(text); return String.format( "<html><head>%s</head><body>%s</body></html>", UIUtil.getCssFontDeclaration(hintHint.getTextFont(), hintHint.getTextForeground(), hintHint.getLinkForeground(), hintHint.getUlImg()), htmlBody ); }
@NotNull public static String prepareHintText(@NotNull String text, @NotNull HintHint hintHint) { return prepareHintText(new Html(text), hintHint); }
public static JEditorPane initPane(@NonNls String text, final HintHint hintHint, @Nullable final JLayeredPane layeredPane) { return initPane(new Html(text), hintHint, layeredPane); }
@Nonnull public static String prepareHintText(@Nonnull String text, @Nonnull HintHint hintHint) { return prepareHintText(new Html(text), hintHint); }