Java Code Examples for com.intellij.util.ui.UIUtil#getCssFontDeclaration()

The following examples show how to use com.intellij.util.ui.UIUtil#getCssFontDeclaration() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PackagesNotificationPanel.java    From vue-for-idea with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void showErrors(@NotNull java.util.List<ValidationInfo> errors) {
    java.util.List<String> errorHtmlDescriptions = ContainerUtil.map(errors, new Function<ValidationInfo, String>() {
        public String fun(ValidationInfo info) {
            return info.getErrorHtmlDescription();
        }
    });
    String styleTag = UIUtil.getCssFontDeclaration(UIUtil.getLabelFont());
    String html = "<html>" + styleTag + "<body><div style='padding-left:4px;'>" + StringUtil.join(errorHtmlDescriptions, "<div style='padding-top:2px;'/>") + "</div></body></html>";

    for (ValidationInfo error : errors) {
        String linkText = error.getLinkText();
        final JTextComponent component = error.getTextComponent();
        if (linkText != null && component != null) {
            this.addLinkHandler(linkText, new Runnable() {
                public void run() {
                    component.requestFocus();
                }
            });
        }
    }
    this.showError(html, null, null);
}
 
Example 2
Source File: ShowBaseRevisionAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
private static String createMessage(VcsRevisionDescription description, final VirtualFile vf) {
  return "<html><head>" + UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()) + "</head><body>" +
         VcsBundle.message("current.version.text", description.getAuthor(),
                           DateFormatUtil.formatPrettyDateTime(description.getRevisionDate()), description.getCommitMessage(),
                           description.getRevisionNumber().asString(), vf.getName()) + "</body></html>";
}
 
Example 3
Source File: IssueLinkHtmlRenderer.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static String formatTextIntoHtml(final Project project, final String c) {
  return "<html><head>" + UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()) + "</head><body>" +
         formatTextWithLinks(project, c) + "</body></html>";
}