Skip to content

Commit

Permalink
reduce usage of getCssFontDeclaration — prefer util method
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Aug 24, 2016
1 parent 46e696f commit 9306ab1
Showing 1 changed file with 2 additions and 16 deletions.
Expand Up @@ -8,6 +8,7 @@
import com.intellij.icons.AllIcons;
import com.intellij.javascript.karma.server.KarmaServer;
import com.intellij.javascript.karma.server.KarmaServerLogComponent;
import com.intellij.layout.LayoutKt;
import com.intellij.openapi.editor.colors.*;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.project.Project;
Expand Down Expand Up @@ -86,22 +87,7 @@ private JEditorPane createEditorPane() {
Font font = colorsScheme.getFont(EditorFontType.PLAIN);
Color background = colorsScheme.getDefaultBackground();
Color foreground = getTextForeground(colorsScheme);

JEditorPane pane = new JEditorPane();
pane.setContentType(UIUtil.HTML_MIME);
pane.setEditable(false);
pane.setFont(font);
pane.setBackground(background);
pane.setForeground(foreground);

String bodyInnerHtml = getWarningMessage();
String html = String.format(
"<html><head>%s</head><body>%s</body></html>",
UIUtil.getCssFontDeclaration(font, foreground, null, null),
bodyInnerHtml
);
pane.setText(html);
return pane;
return LayoutKt.htmlComponent(getWarningMessage(), font, background, foreground);
}

@NotNull
Expand Down

0 comments on commit 9306ab1

Please sign in to comment.