예제 #1
0
 /**
  * Outputs the styles as a single element. Styles are not stored as elements, but part of the
  * document. For the time being styles are written out as a comment, inside a style tag.
  */
 void writeStyles(StyleSheet sheet) throws IOException {
   if (sheet != null) {
     Enumeration styles = sheet.getStyleNames();
     if (styles != null) {
       boolean outputStyle = false;
       while (styles.hasMoreElements()) {
         String name = (String) styles.nextElement();
         // Don't write out the default style.
         if (!StyleContext.DEFAULT_STYLE.equals(name)
             && writeStyle(name, sheet.getStyle(name), outputStyle)) {
           outputStyle = true;
         }
       }
       if (outputStyle) {
         writeStyleEndTag();
       }
     }
   }
 }