下面列出了怎么用javax.swing.text.html.CSS的API类实例代码及写法,或者点击链接到github查看源代码。
private boolean isInvisible( final javax.swing.text.Element textElement ) {
final HTMLDocument htmlDocument = (HTMLDocument) textElement.getDocument();
final StyleSheet sheet = htmlDocument.getStyleSheet();
final AttributeSet attr = computeStyle( textElement, sheet );
final Object o = attr.getAttribute( CSS.Attribute.DISPLAY );
if ( "none".equals( String.valueOf( o ) ) ) {
return true;
}
final Object tag = findTag( textElement.getAttributes() );
if ( tag == HTML.Tag.COMMENT ) {
return true;
}
if ( tag == HTML.Tag.SCRIPT ) {
return true;
}
if ( tag == HTML.Tag.HEAD ) {
return true;
}
return false;
}