src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/TableHeader.java
changeset 48325 e5cdedd37b78
parent 47846 4e78aba768f0
child 54060 53a95878619f
equal deleted inserted replaced
48323:23d427d8a1ff 48325:e5cdedd37b78
    75     public TableHeader(Content... headerCellContents) {
    75     public TableHeader(Content... headerCellContents) {
    76         this.cellContents = Arrays.asList(headerCellContents);
    76         this.cellContents = Arrays.asList(headerCellContents);
    77     }
    77     }
    78 
    78 
    79     /**
    79     /**
       
    80      * Creates a header row, with specified content for each cell.
       
    81      * @param headerCellContents a content object for each header cell
       
    82      */
       
    83     public TableHeader(List<Content> headerCellContents) {
       
    84         this.cellContents = headerCellContents;
       
    85     }
       
    86 
       
    87     /**
    80      * Set the style class names for each header cell.
    88      * Set the style class names for each header cell.
    81      * The number of names must match the number of cells given to the constructor.
    89      * The number of names must match the number of cells given to the constructor.
    82      * @param styles the style class names
    90      * @param styles the style class names
    83      * @return this object
    91      * @return this object
    84      */
    92      */
    85     public TableHeader styles(HtmlStyle... styles) {
    93     public TableHeader styles(HtmlStyle... styles) {
    86         if (styles.length != cellContents.size()) {
    94         if (styles.length != cellContents.size()) {
    87             throw new IllegalStateException();
    95             throw new IllegalStateException();
    88         }
    96         }
    89         this.styles = Arrays.asList(styles);
    97         this.styles = Arrays.asList(styles);
       
    98         return this;
       
    99     }
       
   100 
       
   101     /**
       
   102      * Set the style class names for each header cell.
       
   103      * The number of names must match the number of cells given to the constructor.
       
   104      * @param styles the style class names
       
   105      * @return this object
       
   106      */
       
   107     public TableHeader styles(List<HtmlStyle> styles) {
       
   108         if (styles.size() != cellContents.size()) {
       
   109             throw new IllegalStateException();
       
   110         }
       
   111         this.styles = styles;
    90         return this;
   112         return this;
    91     }
   113     }
    92 
   114 
    93     /**
   115     /**
    94      * Converts this header to a {@link Content} object, for use in an {@link HtmlTree}.
   116      * Converts this header to a {@link Content} object, for use in an {@link HtmlTree}.