Java 类com.intellij.util.ui.Html 实例源码

项目:intellij-ce-playground    文件:DaemonTooltipRendererProvider.java   
@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;
}
项目:consulo    文件:DaemonTooltipRendererProvider.java   
@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;
}
项目:intellij-ce-playground    文件:HintUtil.java   
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
  );
}
项目:intellij-ce-playground    文件:DaemonTooltipRendererProvider.java   
@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));
}
项目:tools-idea    文件:HintUtil.java   
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
  );
}
项目:consulo    文件:HintUtil.java   
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
  );
}
项目:consulo    文件:DaemonTooltipRendererProvider.java   
@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));
}
项目:intellij-ce-playground    文件:HintUtil.java   
@NotNull
public static String prepareHintText(@NotNull String text, @NotNull HintHint hintHint) {
  return prepareHintText(new Html(text), hintHint);
}
项目:intellij-ce-playground    文件:IdeTooltipManager.java   
public static JEditorPane initPane(@NonNls String text, final HintHint hintHint, @Nullable final JLayeredPane layeredPane) {
  return initPane(new Html(text), hintHint, layeredPane);
}
项目:tools-idea    文件:HintUtil.java   
@NotNull
public static String prepareHintText(@NotNull String text, @NotNull HintHint hintHint) {
  return prepareHintText(new Html(text), hintHint);
}
项目:tools-idea    文件:IdeTooltipManager.java   
public static JEditorPane initPane(@NonNls String text, final HintHint hintHint, @Nullable final JLayeredPane layeredPane) {
  return initPane(new Html(text), hintHint, layeredPane);
}
项目:consulo    文件:HintUtil.java   
@Nonnull
public static String prepareHintText(@Nonnull String text, @Nonnull HintHint hintHint) {
  return prepareHintText(new Html(text), hintHint);
}
项目:consulo    文件:IdeTooltipManager.java   
public static JEditorPane initPane(@NonNls String text, final HintHint hintHint, @Nullable final JLayeredPane layeredPane) {
  return initPane(new Html(text), hintHint, layeredPane);
}