org.salespointframework.web.html.viewrepresentations
Class NativeHtmlTable

java.lang.Object
  extended by org.salespointframework.web.html.viewrepresentations.DefaultHtmlViewRepresentation
      extended by org.salespointframework.web.html.viewrepresentations.NativeHtmlTable
All Implemented Interfaces:
HtmlViewRepresentation

public class NativeHtmlTable
extends DefaultHtmlViewRepresentation

Declares a table.
It's using by View.

Author:
Uwe Schmidt, Lars Kreisz

Field Summary
private  GenericHtmlTag cell
           
private  GenericHtmlTag head
           
private  GenericHtmlTag row
           
private  int rowCounter
           
private  boolean zebraStyle
           
 
Fields inherited from class org.salespointframework.web.html.viewrepresentations.DefaultHtmlViewRepresentation
summary
 
Constructor Summary
NativeHtmlTable(boolean zebraStyle)
          Default is 'false'.
 
Method Summary
 java.lang.String getCaption(java.lang.String style, java.lang.String styleName)
          Return String: <caption>
 java.lang.String getCaptioneEnd()
          Return String: </caption>
 java.lang.String getCellEnd()
          Return String: </td>
 java.lang.String getCellStart(java.lang.String styleName)
          Return String: <td>
 java.lang.String getCol(java.lang.String width, java.lang.String span)
          Return String: <col>
 java.lang.String getColEnd()
          Return String: </col>
 java.lang.String getColGroup(java.lang.String width, java.lang.String span)
          Return String: <colgroup>
 java.lang.String getColGroupEnd()
          Return String: </colgroup>
 java.lang.String getColXHtml(java.lang.String width, java.lang.String span)
          Return String: <col/>
 java.lang.String getEnd()
          Return String: </table>
 java.lang.String getHeadEnd()
          Return String: </th>
 java.lang.String getHeadStart(java.lang.String styleName)
          Return String: <th>
 java.lang.String getRowEnd()
          Return String: </tr>
 java.lang.String getRowStart()
          Return String: <tr>
 java.lang.String getStart(java.lang.String id, java.lang.String styleName, java.lang.String style)
          Return String: <table id='... >
 java.lang.String getTBody(java.lang.String style, java.lang.String styleName)
          Return String: <tbody>
 java.lang.String getTBodyEnd()
          Return String: </tbody>
 java.lang.String getTFoot(java.lang.String style, java.lang.String styleName)
          Return String: <tfoot>
 java.lang.String getTFootEnd()
          Return String: </tfoot>
 java.lang.String getTHead(java.lang.String style, java.lang.String styleName)
          Return String: <thead>
 java.lang.String getTHeadEnd()
          Return String: </thead>
 boolean hasBody()
          A table has a body.
 boolean hasCaption()
          A table has a caption.
 boolean hasFooter()
          A table has a footer.
 boolean hasHeader()
          A table has a header.
 boolean hasSummary()
          A table has a summary.
 boolean isZebraStyle()
           
 void setZebraStyle(boolean zebraStyle)
          Default is 'false'.
 
Methods inherited from class org.salespointframework.web.html.viewrepresentations.DefaultHtmlViewRepresentation
setSummary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowCounter

private int rowCounter

zebraStyle

private boolean zebraStyle

head

private GenericHtmlTag head

row

private GenericHtmlTag row

cell

private GenericHtmlTag cell
Constructor Detail

NativeHtmlTable

public NativeHtmlTable(boolean zebraStyle)
Default is 'false'. If 'true' it change the class-attribute between 'table-row-even' and 'table-row-odd'.

Parameters:
zebraStyle -
Method Detail

isZebraStyle

public boolean isZebraStyle()
Returns:
If 'true ZebraStyle is active else it's inactive.

setZebraStyle

public void setZebraStyle(boolean zebraStyle)
Default is 'false'. If 'true' it change the class-attribute between 'table-row-even' and 'table-row-odd'.

Parameters:
zebraStyle -

hasHeader

public boolean hasHeader()
A table has a header.

Specified by:
hasHeader in interface HtmlViewRepresentation
Overrides:
hasHeader in class DefaultHtmlViewRepresentation

hasBody

public boolean hasBody()
A table has a body.

Specified by:
hasBody in interface HtmlViewRepresentation
Overrides:
hasBody in class DefaultHtmlViewRepresentation

hasFooter

public boolean hasFooter()
A table has a footer.

Specified by:
hasFooter in interface HtmlViewRepresentation
Overrides:
hasFooter in class DefaultHtmlViewRepresentation

hasSummary

public boolean hasSummary()
A table has a summary.

Specified by:
hasSummary in interface HtmlViewRepresentation
Overrides:
hasSummary in class DefaultHtmlViewRepresentation

hasCaption

public boolean hasCaption()
A table has a caption.

Specified by:
hasCaption in interface HtmlViewRepresentation
Overrides:
hasCaption in class DefaultHtmlViewRepresentation

getStart

public java.lang.String getStart(java.lang.String id,
                                 java.lang.String styleName,
                                 java.lang.String style)
Return String: <table id='... >

Specified by:
getStart in interface HtmlViewRepresentation
Overrides:
getStart in class DefaultHtmlViewRepresentation
Parameters:
id - The value of the id-attribute of the rendered tag. Be sure it's unique for the whole HTML document.
styleName - The value of the class-attribute of the rendered tag.
style - The value of the style-attribute of the rendered tag.
Returns:
String of HTML-code

getEnd

public java.lang.String getEnd()
Return String: </table>

Specified by:
getEnd in interface HtmlViewRepresentation
Overrides:
getEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getHeadStart

public java.lang.String getHeadStart(java.lang.String styleName)
Return String: <th>

Specified by:
getHeadStart in interface HtmlViewRepresentation
Overrides:
getHeadStart in class DefaultHtmlViewRepresentation
Parameters:
styleName - The value of the class-attribute of the rendered tag.
Returns:
String of HTML-code

getHeadEnd

public java.lang.String getHeadEnd()
Return String: </th>

Specified by:
getHeadEnd in interface HtmlViewRepresentation
Overrides:
getHeadEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getRowStart

public java.lang.String getRowStart()
Return String: <tr>

Specified by:
getRowStart in interface HtmlViewRepresentation
Overrides:
getRowStart in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getRowEnd

public java.lang.String getRowEnd()
Return String: </tr>

Specified by:
getRowEnd in interface HtmlViewRepresentation
Overrides:
getRowEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getCellStart

public java.lang.String getCellStart(java.lang.String styleName)
Return String: <td>

Specified by:
getCellStart in interface HtmlViewRepresentation
Overrides:
getCellStart in class DefaultHtmlViewRepresentation
Parameters:
styleName - The value of the class-attribute of the rendered tag.
Returns:
String of HTML-code

getCellEnd

public java.lang.String getCellEnd()
Return String: </td>

Specified by:
getCellEnd in interface HtmlViewRepresentation
Overrides:
getCellEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getCaption

public java.lang.String getCaption(java.lang.String style,
                                   java.lang.String styleName)
Return String: <caption>

Specified by:
getCaption in interface HtmlViewRepresentation
Overrides:
getCaption in class DefaultHtmlViewRepresentation
Parameters:
style - The value of the style-attribute of the rendered tag.
styleName - The value of the class-attribute of the rendered tag.
Returns:
String of HTML-code

getCaptioneEnd

public java.lang.String getCaptioneEnd()
Return String: </caption>

Specified by:
getCaptioneEnd in interface HtmlViewRepresentation
Overrides:
getCaptioneEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getCol

public java.lang.String getCol(java.lang.String width,
                               java.lang.String span)
Return String: <col>

Specified by:
getCol in interface HtmlViewRepresentation
Overrides:
getCol in class DefaultHtmlViewRepresentation
Parameters:
width - The value of the width-attribute of the rendered tag.
span - The value of the span-attribute of the rendered tag.
Returns:
String of HTML-code

getColEnd

public java.lang.String getColEnd()
Return String: </col>

Specified by:
getColEnd in interface HtmlViewRepresentation
Overrides:
getColEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getColGroup

public java.lang.String getColGroup(java.lang.String width,
                                    java.lang.String span)
Return String: <colgroup>

Specified by:
getColGroup in interface HtmlViewRepresentation
Overrides:
getColGroup in class DefaultHtmlViewRepresentation
Parameters:
width - The value of the width-attribute of the rendered tag.
span - The value of the span-attribute of the rendered tag.
Returns:
String of HTML-code

getColGroupEnd

public java.lang.String getColGroupEnd()
Return String: </colgroup>

Specified by:
getColGroupEnd in interface HtmlViewRepresentation
Overrides:
getColGroupEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getColXHtml

public java.lang.String getColXHtml(java.lang.String width,
                                    java.lang.String span)
Return String: <col/>

Specified by:
getColXHtml in interface HtmlViewRepresentation
Overrides:
getColXHtml in class DefaultHtmlViewRepresentation
Parameters:
width - The value of the width-attribute of the rendered tag.
span - The value of the span-attribute of the rendered tag.
Returns:
String of HTML-code

getTBody

public java.lang.String getTBody(java.lang.String style,
                                 java.lang.String styleName)
Return String: <tbody>

Specified by:
getTBody in interface HtmlViewRepresentation
Overrides:
getTBody in class DefaultHtmlViewRepresentation
Parameters:
style - The value of the style-attribute of the rendered tag.
styleName - The value of the class-attribute of the rendered tag.
Returns:
String of HTML-code

getTBodyEnd

public java.lang.String getTBodyEnd()
Return String: </tbody>

Specified by:
getTBodyEnd in interface HtmlViewRepresentation
Overrides:
getTBodyEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getTFoot

public java.lang.String getTFoot(java.lang.String style,
                                 java.lang.String styleName)
Return String: <tfoot>

Specified by:
getTFoot in interface HtmlViewRepresentation
Overrides:
getTFoot in class DefaultHtmlViewRepresentation
Parameters:
style - The value of the style-attribute of the rendered tag.
styleName - The value of the class-attribute of the rendered tag.
Returns:
String of HTML-code

getTFootEnd

public java.lang.String getTFootEnd()
Return String: </tfoot>

Specified by:
getTFootEnd in interface HtmlViewRepresentation
Overrides:
getTFootEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code

getTHead

public java.lang.String getTHead(java.lang.String style,
                                 java.lang.String styleName)
Return String: <thead>

Specified by:
getTHead in interface HtmlViewRepresentation
Overrides:
getTHead in class DefaultHtmlViewRepresentation
Parameters:
style - The value of the style-attribute of the rendered tag.
styleName - The value of the class-attribute of the rendered tag.
Returns:
String of HTML-code

getTHeadEnd

public java.lang.String getTHeadEnd()
Return String: </thead>

Specified by:
getTHeadEnd in interface HtmlViewRepresentation
Overrides:
getTHeadEnd in class DefaultHtmlViewRepresentation
Returns:
String of HTML-code