@Override
protected void initStylesForTextPane(final JTextPane textPane) {
textPane.setContentType("text/html");
final HTMLDocument doc = (HTMLDocument) textPane.getDocument();
final StyleSheet css = doc.getStyleSheet();
/*
* Configure standard styles
*/
css.addRule("body { font-family: Dialog; font-size: " + (TEXT_SIZE + 1)
+ "pt }");
css.addRule("a { color: blue; font-style: italic }");
css.addRule("._timestamp { color: " + colorToRGB(HEADER_COLOR)
+ "; font-size: " + (TEXT_SIZE - 1)
+ "pt; font-style: italic }");
css.addRule("._header { color: " + colorToRGB(HEADER_COLOR) + " }");
/*
* Configure notification types
*/
for (final NotificationType type : NotificationType.values()) {
final Color color = type.getColor();
if (color != null) {
css.addRule("." + type.getMnemonic() + " { color: "
+ colorToRGB(color) + "; font-weight: bold; }");
}
}
}