本文整理了Java中javax.swing.text.html.StyleSheet.addCSSAttribute()
方法的一些代码示例,展示了StyleSheet.addCSSAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StyleSheet.addCSSAttribute()
方法的具体详情如下:
包路径:javax.swing.text.html.StyleSheet
类名称:StyleSheet
方法名:addCSSAttribute
暂无
代码示例来源:origin: org.netbeans.api/org-openide-awt
@Override
public void addCSSAttribute( MutableAttributeSet attr, Attribute key, String value ) {
value = fixFontSize( key, value );
super.addCSSAttribute( attr, key, value );
}
代码示例来源:origin: org.eclipse.scout.rt/org.eclipse.scout.commons
if (style == null) {
style = styleSheet.addStyle("p", null);
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_LEFT, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_RIGHT, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_TOP, "4");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_BOTTOM, "4");
styleSheet.addCSSAttribute(style, CSS.Attribute.PADDING_LEFT, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.PADDING_RIGHT, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.PADDING_TOP, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.PADDING_BOTTOM, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.COLOR, "#3366cc");
styleSheet.addCSSAttribute(style, CSS.Attribute.TEXT_DECORATION, "underline");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_TOP, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_LEFT, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_BOTTOM, "0");
styleSheet.addCSSAttribute(style, CSS.Attribute.MARGIN_RIGHT, "0");
if (m.matches()) {
value = m.group(1);
styleSheet.addCSSAttribute(style, cssAtt, value);
if (m.matches()) {
value = "#" + m.group(1) + m.group(1) + m.group(2) + m.group(2) + m.group(3) + m.group(3);
代码示例来源:origin: org.eclipse.scout.rt/org.eclipse.scout.commons
URL url = cidToUrlMapping.get(cid);
if (url != null) {
styleSheet.addCSSAttribute(style, cssAtt, "url(" + url.toExternalForm() + ")");
changeCount.setValue(changeCount.getValue() + 1);
代码示例来源:origin: org.eclipse.scout.rt/org.eclipse.scout.commons
private static void setDefaultFont(StyleSheet styleSheet, String styleName, DefaultFont defaultFont) {
if (defaultFont == null) {
return;
}
Style style = styleSheet.getStyle(styleName);
if (style == null) {
style = styleSheet.addStyle(styleName, null);
}
String family = defaultFont.getFamiliesConcatenated();
if (style.getAttribute(CSS.Attribute.FONT_FAMILY) == null && family != null) {
styleSheet.addCSSAttribute(style, CSS.Attribute.FONT_FAMILY, family);
}
if (style.getAttribute(CSS.Attribute.FONT_SIZE) == null && defaultFont.getSize() > 0 && defaultFont.getSizeUnit() != null) {
styleSheet.addCSSAttribute(style, CSS.Attribute.FONT_SIZE, defaultFont.getSize() + defaultFont.getSizeUnit());
}
}
代码示例来源:origin: org.eclipse.scout.rt/org.eclipse.scout.commons
styleSheet.addCSSAttribute(aStyle, CSS.Attribute.COLOR, colorAttributeValue);
内容来源于网络,如有侵权,请联系作者删除!