List of usage examples for javax.swing.text StyleConstants setItalic
public static void setItalic(MutableAttributeSet a, boolean b)
From source file:pl.otros.logview.gui.message.pattern.StyleProperties.java
public static Style getStyle(StyleContext styleContext, DataConfiguration styleConfig, String styleName, int group) { Style style = styleContext.addStyle(styleName, styleContext.getStyle(StyleContext.DEFAULT_STYLE)); String groupSuffix = "." + group; if (group <= 0) { groupSuffix = ""; }//from ww w . j ava 2 s . co m String fontFamily = styleConfig.getString(PROP_FONT_FAMILY + groupSuffix, ""); if (fontFamily.trim().length() > 0) { StyleConstants.setFontFamily(style, styleConfig.getString(PROP_FONT_FAMILY + groupSuffix)); } if (styleConfig.getString(PROP_FONT_SIZE + groupSuffix, "").trim().length() > 0) { StyleConstants.setFontSize(style, styleConfig.getInt(PROP_FONT_SIZE + groupSuffix)); } if (styleConfig.getString(PROP_FONT_BOLD + groupSuffix, "").trim().length() > 0) { StyleConstants.setBold(style, styleConfig.getBoolean(PROP_FONT_BOLD + groupSuffix)); } if (styleConfig.getString(PROP_FONT_ITALIC + groupSuffix, "").trim().length() > 0) { StyleConstants.setItalic(style, styleConfig.getBoolean(PROP_FONT_ITALIC + groupSuffix)); } if (styleConfig.getString(PROP_FONT_UNDERLINE + groupSuffix, "").trim().length() > 0) { StyleConstants.setUnderline(style, styleConfig.getBoolean(PROP_FONT_UNDERLINE + groupSuffix)); } if (styleConfig.getString(PROP_BACKGROUND + groupSuffix, "").trim().length() > 0) { StyleConstants.setBackground(style, styleConfig.getColor(PROP_BACKGROUND + groupSuffix)); } if (styleConfig.getString(PROP_FOREGROUND + groupSuffix, "").trim().length() > 0) { StyleConstants.setForeground(style, styleConfig.getColor(PROP_FOREGROUND + groupSuffix)); } return style; }