javax.swing.text.html.CSS Java Examples

The following examples show how to use javax.swing.text.html.CSS. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HtmlRichTextConverter.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
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;
}